aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2023-09-03 23:58:10 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-09-13 09:02:23 +0000
commit9ebb4aadaeb1512bbfdcee1a01798287615d1984 (patch)
tree99110e87a84ebbbf8bdf5d3083056387e755312d
parent3b1b942c429c8343ca42b87facbafd5d6adc1ea2 (diff)
Fix navigation key test cases
These tests have been broken since the introduction of new layouts. For new layouts the initial key must be change for certain tests to avoid never ending loops caused by the simple navigation logic implemented in the test case. I debugged the Keyboard navigation key logic for hours and concluded it works as designed. Pick-to: 6.5 Change-Id: Ib83ec5d74e22ffe5eca92a67aacad48e2b34740d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 4f50e30e698e8a2213de5b7e54319de168073a84) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/auto/inputpanel/data/tst_inputpanel.qml15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml
index 635fb26c..761fff45 100644
--- a/tests/auto/inputpanel/data/tst_inputpanel.qml
+++ b/tests/auto/inputpanel/data/tst_inputpanel.qml
@@ -635,9 +635,9 @@ Rectangle {
function test_navigationKeyInputSequence_data() {
return [
- { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase, inputSequence: "\u00E1\u017C", outputText: "\u00E1\u017C" },
- { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase, inputSequence: "~123qwe", outputText: "~123qwe" },
- { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase, inputSequence: [ Qt.Key_Shift, Qt.Key_V, Qt.Key_K, Qt.Key_B, Qt.Key_Return ], outputText: "VKB\n" },
+ { initialKey: Qt.Key_Space, initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase, inputSequence: "\u00E1\u017C", outputText: "\u00E1\u017C" },
+ { initialKey: Qt.Key_Space, initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase, inputSequence: "~123qwe", outputText: "~123qwe" },
+ { initialKey: Qt.Key_Space, initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase, inputSequence: [ Qt.Key_Shift, Qt.Key_Shift, Qt.Key_V, Qt.Key_K, Qt.Key_B, Qt.Key_Return ], outputText: "VKB\n" },
]
}
@@ -648,6 +648,7 @@ Rectangle {
skip("Arrow key navigation not enabled")
verify(inputPanel.naviationHighlight.visible)
+ verify(inputPanel.navigateToKey(data.initialKey))
for (var inputIndex in data.inputSequence) {
verify(inputPanel.navigationKeyClick(data.inputSequence[inputIndex]))
@@ -660,8 +661,8 @@ Rectangle {
function test_navigationCursorWrap_data() {
return [
- { initialKey: Qt.Key_Q, navigationKey: Qt.Key_Up, navigationKeyRepeat: 4 },
- { initialKey: Qt.Key_Q, navigationKey: Qt.Key_Down, navigationKeyRepeat: 4 },
+ { initialKey: Qt.Key_W, navigationKey: Qt.Key_Up, navigationKeyRepeat: 4 },
+ { initialKey: Qt.Key_W, navigationKey: Qt.Key_Down, navigationKeyRepeat: 4 },
{ initialKey: Qt.Key_T, navigationKey: Qt.Key_Up, navigationKeyRepeat: 4 },
{ initialKey: Qt.Key_T, navigationKey: Qt.Key_Down, navigationKeyRepeat: 4 },
{ initialKey: Qt.Key_Backspace, navigationKey: Qt.Key_Up, navigationKeyRepeat: 4 },
@@ -694,7 +695,7 @@ Rectangle {
}
}
- verify(inputPanel.keyboardInputArea.initialKey === initialKeyObj)
+ compare(inputPanel.keyboardInputArea.initialKey, initialKeyObj)
}
function test_navigationCursorAndWordCandidateView() {
@@ -810,7 +811,7 @@ Rectangle {
var keysTraversed = []
do {
- verify(keysTraversed.indexOf(inputPanel.keyboardInputArea.initialKey) === -1)
+ compare(keysTraversed.indexOf(inputPanel.keyboardInputArea.initialKey), -1)
var currentKey = inputPanel.keyboardInputArea.initialKey
keysTraversed.push(currentKey)
inputPanel.emulateNavigationKeyClick(Qt.Key_Right)