From 87618403976aa82450895da6196a944195980de7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 18 Jul 2012 13:12:59 +0200 Subject: 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 --- tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests/auto/other/qaccessibility/tst_qaccessibility.cpp') diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index fef81008a7..f06fa92ff1 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -798,10 +798,11 @@ void tst_QAccessibility::mainWindowTest() QMainWindow *mw = new QMainWindow; mw->resize(300, 200); mw->show(); // triggers layout + qApp->setActiveWindow(mw); QLatin1String name = QLatin1String("I am the main window"); mw->setWindowTitle(name); - QTest::qWaitForWindowShown(mw); + QVERIFY(QTest::qWaitForWindowActive(mw)); // The order of events is not really that important. QAccessibleEvent show(mw, QAccessible::ObjectShow); @@ -1638,10 +1639,8 @@ void tst_QAccessibility::mdiSubWindowTest() QMdiArea mdiArea; mdiArea.show(); qApp->setActiveWindow(&mdiArea); -#if defined(Q_OS_UNIX) - QCoreApplication::processEvents(); - QTest::qWait(150); -#endif + QVERIFY(QTest::qWaitForWindowActive(&mdiArea)); + const int subWindowCount = 5; for (int i = 0; i < subWindowCount; ++i) { -- cgit v1.2.3