aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/inputpanel/data/inputpanel/inputpanel.qml11
-rw-r--r--tests/auto/inputpanel/data/tst_inputpanel.qml16
2 files changed, 24 insertions, 3 deletions
diff --git a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
index dfdb941b..ded8aee3 100644
--- a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
+++ b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
@@ -91,6 +91,7 @@ InputPanel {
property alias wordCandidateListVisibleSpy: wordCandidateListVisibleSpy
property alias shiftStateSpy: shiftStateSpy
property alias shadowInputControlVisibleSpy: shadowInputControlVisibleSpy
+ property alias externalLanguageSwitchSpy: externalLanguageSwitchSpy
signal inputMethodResult(var text)
@@ -188,6 +189,12 @@ InputPanel {
signalName: "onVisibleChanged"
}
+ SignalSpy {
+ id: externalLanguageSwitchSpy
+ target: inputPanel
+ signalName: "onExternalLanguageSwitch"
+ }
+
function findChildByProperty(parent, propertyName, propertyValue, compareCb) {
var obj = null
if (parent === null)
@@ -293,6 +300,10 @@ InputPanel {
return true
}
+ function setExternalLanguageSwitchEnabled(enabled) {
+ externalLanguageSwitchEnabled = enabled
+ }
+
function findVirtualKey(key) {
return Utils.findChild(keyboardLayoutLoader, key, function(obj, param) {
if (!obj.hasOwnProperty("key") || !obj.hasOwnProperty("text"))
diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml
index 61d6f509..f9164f97 100644
--- a/tests/auto/inputpanel/data/tst_inputpanel.qml
+++ b/tests/auto/inputpanel/data/tst_inputpanel.qml
@@ -82,6 +82,7 @@ Rectangle {
inputPanel.setWclAlwaysVisible(data !== undefined && data.hasOwnProperty("wclAlwaysVisible") && data.wclAlwaysVisible)
inputPanel.setWclAutoCommitWord(data !== undefined && data.hasOwnProperty("wclAutoCommitWord") && data.wclAutoCommitWord)
inputPanel.setFullScreenMode(data !== undefined && data.hasOwnProperty("fullScreenMode") && data.fullScreenMode)
+ inputPanel.setExternalLanguageSwitchEnabled(data !== undefined && data.hasOwnProperty("externalLanguageSwitchEnabled") && data.externalLanguageSwitchEnabled)
container.forceActiveFocus()
if (data !== undefined && data.hasOwnProperty("initText")) {
textInput.text = data.initText
@@ -1527,14 +1528,23 @@ Rectangle {
}
}
- function test_languagePopupListToggle() {
- prepareTest()
+ function test_languagePopupListToggle_data() {
+ return [
+ { externalLanguageSwitchEnabled: true },
+ { externalLanguageSwitchEnabled: false },
+ ]
+ }
+
+ function test_languagePopupListToggle(data) {
+ prepareTest(data)
if (inputPanel.availableLocales.length < 2)
skip("Input language can not be changed")
var changeLanguageKey = inputPanel.findObjectByName("changeLanguageKey")
var languagePopupList = inputPanel.findObjectByName("languagePopupList")
+ inputPanel.externalLanguageSwitchSpy.clear()
inputPanel.virtualKeyClick(changeLanguageKey)
- compare(languagePopupList.visible, true)
+ compare(languagePopupList.visible, !data.externalLanguageSwitchEnabled)
+ compare(inputPanel.externalLanguageSwitchSpy.count, data.externalLanguageSwitchEnabled ? 1 : 0)
inputPanel.virtualKeyClick(changeLanguageKey)
compare(languagePopupList.visible, false)
}