summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_shortcuts.qml
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@digia.com>2013-06-21 10:08:38 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-02 11:20:18 +0200
commit8f8deec53e32119a80b2ff5e8cad83cfd7e5776c (patch)
tree2266c69145974aad5303a7caad68e09817672c1f /tests/auto/controls/data/tst_shortcuts.qml
parentc79ed398e6d70717243feccb78e362ed1ee819eb (diff)
downloadqtquickcontrols-8f8deec53e32119a80b2ff5e8cad83cfd7e5776c.tar.gz
Tests: Fix warnings in tests
Ignore warning messages when they are expected. Fix real warnings. Also add missing tst_layout.qml to the test pro file. Change-Id: I2a3835d386570aeb993f275793b3e5e69cc41599 Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_shortcuts.qml')
-rw-r--r--tests/auto/controls/data/tst_shortcuts.qml27
1 files changed, 17 insertions, 10 deletions
diff --git a/tests/auto/controls/data/tst_shortcuts.qml b/tests/auto/controls/data/tst_shortcuts.qml
index b28d24a9..80f34192 100644
--- a/tests/auto/controls/data/tst_shortcuts.qml
+++ b/tests/auto/controls/data/tst_shortcuts.qml
@@ -67,18 +67,19 @@ TestCase {
function test_shortcut_data() {
return [
- { key: Qt.Key_A, modifier: Qt.NoModifier, expected: "a pressed" },
- { key: Qt.Key_B, modifier: Qt.NoModifier, expected: "b pressed" },
- { key: Qt.Key_C, modifier: Qt.NoModifier, expected: "no key press" },
- { key: Qt.Key_C, modifier: Qt.ControlModifier, expected: "ctrl c pressed" },
- { key: Qt.Key_D, modifier: Qt.NoModifier, expected: "d pressed" },
- { key: Qt.Key_D, modifier: Qt.ControlModifier, expected: "no key press" },
+ { tag: "a_pressed", key: Qt.Key_A, modifier: Qt.NoModifier, expected: "a pressed" },
+ { tag: "b_pressed", key: Qt.Key_B, modifier: Qt.NoModifier, expected: "b pressed" },
+ { tag: "nokey_pressed1", key: Qt.Key_C, modifier: Qt.NoModifier, expected: "no key press" },
+ { tag: "ctrlc_pressed", key: Qt.Key_C, modifier: Qt.ControlModifier, expected: "ctrl c pressed" },
+ { tag: "dpressed", key: Qt.Key_D, modifier: Qt.NoModifier, expected: "d pressed" },
+ { tag: "nokey_pressed2", key: Qt.Key_D, modifier: Qt.ControlModifier, expected: "no key press" },
// shift d is not triggered because it is overloaded
- { key: Qt.Key_D, modifier: Qt.ShiftModifier, expected: "no key press" },
- { key: Qt.Key_D, modifier: Qt.AltModifier, expected: "alt d pressed" },
- { key: Qt.Key_T, modifier: Qt.NoModifier, expected: "no key press" },
+ { tag: "overloaded", key: Qt.Key_D, modifier: Qt.ShiftModifier, expected: "no key press",
+ warning: "QQuickAction::event: Ambiguous shortcut overload: Shift+D" },
+ { tag: "aldd_pressed", key: Qt.Key_D, modifier: Qt.AltModifier, expected: "alt d pressed" },
+ { tag: "nokey_pressed3", key: Qt.Key_T, modifier: Qt.NoModifier, expected: "no key press" },
// on mac we don't have mnemonics
- { key: Qt.Key_T, modifier: Qt.AltModifier, expected: Qt.platform.os === "osx" ? "no key press" : "alt t pressed" },
+ { tag: "mnemonics", key: Qt.Key_T, modifier: Qt.AltModifier, expected: Qt.platform.os === "osx" ? "no key press" : "alt t pressed" },
]
}
@@ -88,6 +89,12 @@ TestCase {
var text = rootObject.children[0];
text.text = "no key press";
+ if (data.warning !== undefined) {
+ if (Qt.platform.os === "osx" && data.tag === "overloaded")
+ ignoreWarning("QQuickAction::event: Ambiguous shortcut overload: ?D") // QTBUG_32089
+ else
+ ignoreWarning(data.warning)
+ }
keyPress(data.key, data.modifier);
verify(text != undefined);