From 4f50e30e698e8a2213de5b7e54319de168073a84 Mon Sep 17 00:00:00 2001 From: Jarkko Koivikko Date: Sun, 3 Sep 2023 23:58:10 +0300 Subject: 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 6.6 Change-Id: Ib83ec5d74e22ffe5eca92a67aacad48e2b34740d Reviewed-by: Mitch Curtis Reviewed-by: Qt CI Bot --- tests/auto/inputpanel/data/tst_inputpanel.qml | 15 ++++++++------- 1 file 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) -- cgit v1.2.3