aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2018-08-22 23:41:37 +0300
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2018-08-27 12:43:28 +0000
commita499ebb5042bd1fb060339befbd28f2bfec370af (patch)
treea73126604ba28624b85341c8dd07560612355524
parent907f11717df5523dce81270ef41e376c7660f407 (diff)
Fix regression in test_wclAutoCommitWordSetting
Commit e803aec1ea21fd00e13b9535a4b536cc43c26ee4 modified the test case and caused regression. The idea was correct, but the implementation used SignalSpy for model.dataChanged, which is ambiguous, since there are multiple signals per update. This change introduce inputMethodSelectionListChangedSpy which monitors selectionListChanged signal from the input method. This is reliable, as long as suggestions are generated background. Change-Id: Ica2710b8c389c13e1a1b1d28027667e031bc4f59 Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
-rw-r--r--tests/auto/inputpanel/data/inputpanel/inputpanel.qml7
-rw-r--r--tests/auto/inputpanel/data/tst_inputpanel.qml4
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
index 01fc2ede..2e183092 100644
--- a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
+++ b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
@@ -89,6 +89,7 @@ InputPanel {
property alias soundEffectSpy: soundEffectSpy
property alias inputMethodResultSpy: inputMethodResultSpy
property alias wordCandidateListChangedSpy: wordCandidateListChangedSpy
+ property alias inputMethodSelectionListChangedSpy: inputMethodSelectionListChangedSpy
property alias wordCandidateListVisibleSpy: wordCandidateListVisibleSpy
property alias shiftStateSpy: shiftStateSpy
property alias shadowInputControlVisibleSpy: shadowInputControlVisibleSpy
@@ -173,6 +174,12 @@ InputPanel {
}
SignalSpy {
+ id: inputMethodSelectionListChangedSpy
+ target: InputContext.inputEngine.inputMethod
+ signalName: "selectionListChanged"
+ }
+
+ SignalSpy {
id: wordCandidateListVisibleSpy
target: wordCandidateView
signalName: "onVisibleConditionChanged"
diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml
index 74e8da8a..b3173517 100644
--- a/tests/auto/inputpanel/data/tst_inputpanel.qml
+++ b/tests/auto/inputpanel/data/tst_inputpanel.qml
@@ -1824,8 +1824,8 @@ Rectangle {
for (var len = 1; len <= 5; ++len) {
inputPanel.virtualKeyClick("z")
if (len >= 2) {
- inputPanel.wordCandidateListChangedSpy.clear()
- inputPanel.wordCandidateListChangedSpy.wait()
+ inputPanel.inputMethodSelectionListChangedSpy.clear()
+ inputPanel.inputMethodSelectionListChangedSpy.wait()
if (inputPanel.wordCandidateView.model.count <= 1)
break
}