summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-07-18 13:12:59 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-20 09:27:28 +0200
commit87618403976aa82450895da6196a944195980de7 (patch)
tree906d035678d8a31e57a94c01e8756b0085b3e1e4 /tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
parentc081107206cb1d31415539c4429f7896b997cf71 (diff)
Implement waitForWindowExposed and friends for widget windows.
- Implement waitForWindowExposed() for toplevel windows. - Implement waitForWindowShown(QWidget *) and mark as deprecated in line with waitForWindowShown(QWindow*). - Use in tests. - Simplify tests (collapse waitForExposed, setActive into setActiveWindow, waitForActive), remove most hard-coded timeouts. - Stabilize graphicsview tests by using waitForWindowActive. Change-Id: Ic7c061e2745b36f71a715ee4e47c0346b11a91e8 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp')
-rw-r--r--tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
index 971f60bb3e..dd91e6968f 100644
--- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
+++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
@@ -1004,9 +1004,7 @@ void tst_QShortcut::context()
layout->addWidget(other1);
layout->addWidget(other2);
myBox.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&myBox);
-#endif
+ QVERIFY(QTest::qWaitForWindowExposed(&myBox));
setupShortcut(other1, "ActiveWindow", TriggerSlot1, QKeySequence("Alt+1"), Qt::WindowShortcut);
setupShortcut(other2, "Focus", TriggerSlot2, QKeySequence("Alt+2"), Qt::WidgetShortcut);
@@ -1076,11 +1074,7 @@ void tst_QShortcut::context()
other2->activateWindow();
other2->setFocus(); // ###
qApp->syncX();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(other2);
-#endif
- QTest::qWait(100);
- QCOMPARE(qApp->activeWindow(), other2->window());
+ QTRY_COMPARE(qApp->activeWindow(), other2->window());
QCOMPARE(qApp->focusWidget(), (QWidget *)other2);
currentResult = NoResult;
@@ -1097,14 +1091,6 @@ void tst_QShortcut::context()
QCOMPARE(other2->toPlainText(), QString(""));
clearAllShortcuts();
- delete other1;
- delete other2;
- edit->activateWindow();
- qApp->syncX();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(edit);
-#endif
- QTest::qWait(100);
}
// ------------------------------------------------------------------