Stabilize tst_QMdiArea::subWindowList

Flakily failed on openSUSE.

Task-number: QTBUG-68170
Change-Id: Ic75e081238ccf4bad54de39e6bdaa892796b599e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Kari Oikarinen 2018-05-08 13:19:06 +03:00
parent e110ab6c28
commit 7eab9ec63b

View File

@ -1400,6 +1400,7 @@ void tst_QMdiArea::subWindowList()
QMdiArea workspace;
workspace.show();
qApp->setActiveWindow(&workspace);
QVERIFY(QTest::qWaitForWindowActive(&workspace));
QList<QMdiSubWindow *> activationOrder;
QVector<QMdiSubWindow *> windows;
@ -1418,8 +1419,7 @@ void tst_QMdiArea::subWindowList()
windows[staysOnTop1]->setWindowFlags(windows[staysOnTop1]->windowFlags() | Qt::WindowStaysOnTopHint);
workspace.setActiveSubWindow(windows[activeSubWindow]);
qApp->processEvents();
QCOMPARE(workspace.activeSubWindow(), windows[activeSubWindow]);
QTRY_COMPARE(workspace.activeSubWindow(), windows[activeSubWindow]);
activationOrder.move(activationOrder.indexOf(windows[activeSubWindow]), windowCount - 1);
QList<QMdiSubWindow *> subWindows = workspace.subWindowList(windowOrder);
@ -1441,13 +1441,11 @@ void tst_QMdiArea::subWindowList()
windows[staysOnTop2]->setWindowFlags(windows[staysOnTop2]->windowFlags() | Qt::WindowStaysOnTopHint);
workspace.setActiveSubWindow(windows[staysOnTop2]);
qApp->processEvents();
QCOMPARE(workspace.activeSubWindow(), windows[staysOnTop2]);
QTRY_COMPARE(workspace.activeSubWindow(), windows[staysOnTop2]);
activationOrder.move(activationOrder.indexOf(windows[staysOnTop2]), windowCount - 1);
workspace.setActiveSubWindow(windows[activeSubWindow]);
qApp->processEvents();
QCOMPARE(workspace.activeSubWindow(), windows[activeSubWindow]);
QTRY_COMPARE(workspace.activeSubWindow(), windows[activeSubWindow]);
activationOrder.move(activationOrder.indexOf(windows[activeSubWindow]), windowCount - 1);
QList<QMdiSubWindow *> widgets = workspace.subWindowList(windowOrder);