summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-08 11:49:01 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-08 11:50:48 (GMT)
commit039e178ae3dff6761627de9b3fa790a64afb7bee (patch)
treef929404ddf6c76f9434526603eb363fc170c3fdb /tests
parent0399ace27c7441b4454911da3aaa4ea17b931b99 (diff)
downloadQt-039e178ae3dff6761627de9b3fa790a64afb7bee.zip
Qt-039e178ae3dff6761627de9b3fa790a64afb7bee.tar.gz
Qt-039e178ae3dff6761627de9b3fa790a64afb7bee.tar.bz2
Make tst_qmdiarea more robust
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qmdiarea/tst_qmdiarea.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/auto/qmdiarea/tst_qmdiarea.cpp b/tests/auto/qmdiarea/tst_qmdiarea.cpp
index 65dab48..246410d 100644
--- a/tests/auto/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/qmdiarea/tst_qmdiarea.cpp
@@ -62,6 +62,8 @@
#endif
#include <QMacStyle>
+#include "../../shared/util.h"
+
static const Qt::WindowFlags DefaultWindowFlags
= Qt::SubWindow | Qt::WindowSystemMenuHint
| Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint;
@@ -467,7 +469,7 @@ void tst_QMdiArea::subWindowActivated2()
qt_x11_wait_for_window_manager(&mdiArea);
#endif
- QCOMPARE(spy.count(), 5);
+ QTRY_COMPARE(spy.count(), 5);
QCOMPARE(mdiArea.activeSubWindow(), mdiArea.subWindowList().back());
spy.clear();
@@ -493,7 +495,7 @@ void tst_QMdiArea::subWindowActivated2()
qt_x11_wait_for_window_manager(&mdiArea);
#endif
QTest::qWait(100);
- QCOMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.count(), 1);
QVERIFY(!mdiArea.activeSubWindow());
QCOMPARE(mdiArea.currentSubWindow(), activeSubWindow);
spy.clear();
@@ -503,7 +505,7 @@ void tst_QMdiArea::subWindowActivated2()
qt_x11_wait_for_window_manager(&mdiArea);
#endif
QTest::qWait(100);
- QCOMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.count(), 1);
QCOMPARE(mdiArea.activeSubWindow(), activeSubWindow);
spy.clear();
@@ -516,14 +518,14 @@ void tst_QMdiArea::subWindowActivated2()
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "showMinimized doesn't really minimize if you don't have access to the server", Abort);
#endif
- QTest::qWait(100);
+ QTest::qWait(10);
#if defined(Q_WS_QWS)
QEXPECT_FAIL("", "task 168682", Abort);
#endif
#ifdef Q_OS_WINCE
QSKIP("Not fixed yet. See Task 197453", SkipAll);
#endif
- QCOMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.count(), 1);
QVERIFY(!mdiArea.activeSubWindow());
QCOMPARE(mdiArea.currentSubWindow(), activeSubWindow);
spy.clear();
@@ -533,7 +535,7 @@ void tst_QMdiArea::subWindowActivated2()
qt_x11_wait_for_window_manager(&mdiArea);
#endif
QTest::qWait(100);
- QCOMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.count(), 1);
QCOMPARE(mdiArea.activeSubWindow(), activeSubWindow);
spy.clear();
}
@@ -1734,6 +1736,7 @@ void tst_QMdiArea::tileSubWindows()
qt_x11_wait_for_window_manager(&workspace);
#endif
qApp->processEvents();
+ QTRY_COMPARE(workspace.size(), QSize(350, 150));
const QSize minSize(300, 100);
foreach (QMdiSubWindow *subWindow, workspace.subWindowList())
@@ -1885,7 +1888,7 @@ void tst_QMdiArea::resizeMaximizedChildWindows()
workspace.resize(workspaceSize + QSize(increment, increment));
QTest::qWait(100);
qApp->processEvents();
- QCOMPARE(workspace.size(), workspaceSize + QSize(increment, increment));
+ QTRY_COMPARE(workspace.size(), workspaceSize + QSize(increment, increment));
QCOMPARE(window->size(), windowSize + QSize(increment, increment));
workspaceSize = workspace.size();
}