diff options
author | Liang Qi <liang.qi@qt.io> | 2016-12-12 09:49:11 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-12-12 10:14:11 +0100 |
commit | c43f532eaa0e562239f999a7ccc4c58d433707bf (patch) | |
tree | fec61e8e1a8d3c29ae4ab265477db93ad1121c68 /tests | |
parent | d51fd422289d8077ef23dd3b5f8d2df6827787b6 (diff) | |
parent | adabc870bc1e60bb57edb6be21471d1c3f83b923 (diff) |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
src/config.pri
tests/auto/inputpanel/data/tst_inputpanel.qml
Change-Id: Ib84bbfee8097cf807dbdffb37dfdfc344fc2dbbf
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/inputpanel/data/inputpanel/inputpanel.qml | 7 | ||||
-rw-r--r-- | tests/auto/inputpanel/data/tst_inputpanel.qml | 24 |
2 files changed, 30 insertions, 1 deletions
diff --git a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml index 5a7dfc11..4d42d941 100644 --- a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml +++ b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml @@ -83,6 +83,7 @@ InputPanel { property alias soundEffectSpy: soundEffectSpy property alias inputMethodResultSpy: inputMethodResultSpy property alias wordCandidateListChangedSpy: wordCandidateListChangedSpy + property alias shiftStateSpy: shiftStateSpy signal inputMethodResult(var text) @@ -162,6 +163,12 @@ InputPanel { signalName: "dataChanged" } + SignalSpy { + id: shiftStateSpy + target: InputContext + signalName: "onShiftChanged" + } + function findChildByProperty(parent, propertyName, propertyValue, compareCb) { var obj = null if (parent === null) diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml index 1fedfc51..ed4f37ef 100644 --- a/tests/auto/inputpanel/data/tst_inputpanel.qml +++ b/tests/auto/inputpanel/data/tst_inputpanel.qml @@ -327,10 +327,11 @@ Rectangle { } function test_inputMethodHints_data() { + var decmialPoint = Qt.locale().decimalPoint return [ { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhUppercaseOnly, inputSequence: "uppercase text? yes.", outputText: "UPPERCASE TEXT? YES." }, { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhLowercaseOnly, inputSequence: "uppercase text? no.", outputText: "uppercase text? no." }, - { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDigitsOnly, inputSequence: "1234567890.", outputText: "1234567890." }, + { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDigitsOnly, inputSequence: "1234567890" + decmialPoint, outputText: "1234567890" + decmialPoint }, { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly, inputSequence: "1234567890+-,.()", outputText: "1234567890+-,.()" }, { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDialableCharactersOnly, inputSequence: "1234567890+*#", outputText: "1234567890+*#" }, ] @@ -424,6 +425,27 @@ Rectangle { compare(textInput.text, data.outputText) } + function test_focusAndShiftState() { + prepareTest() + + // Initial focus is set to textInput, shift state should not change + // when focus is set to container + inputPanel.shiftStateSpy.clear() + container.forceActiveFocus() + compare(inputPanel.shiftStateSpy.count, 0, "Unexpected number of shift state changes after focus change (ImhNone -> ImhNone)") + + // Change to lower case + inputPanel.shiftStateSpy.clear() + inputPanel.toggleShift() + compare(inputPanel.shiftStateSpy.count, 1, "Unexpected number of shift state changes after shift key press") + + // Set focus back to textInput, and expect that shift state is changed + // to auto upper case + inputPanel.shiftStateSpy.clear() + textInput.forceActiveFocus() + compare(inputPanel.shiftStateSpy.count, 1, "Unexpected number of shift state changes after focus change (auto upper case)") + } + function test_symbolMode() { prepareTest({ initInputMethodHints: Qt.ImhNoPredictiveText }) |