diff options
author | Jan Arve Saether <jan-arve.saether@qt.io> | 2017-07-31 19:24:33 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-08-03 12:52:04 +0000 |
commit | 0577c9f35628ac2f63e6ce4e6fa73bb4614e29ae (patch) | |
tree | 4368e34d6f501851c1c7e50dcc6e3ea04369d718 /tests | |
parent | 3eb90a1fa996e42647e073dc8e1b7fcf9a68a8d2 (diff) |
Fix flaky failure in attachedProperty() autotest
QVERIFY(QTest::qWaitForWindowActive(&view)) sometimes failed.
This was because at that point, "view" already had been active, then
turned inactive again due to that the "extraWindow" had become active.
The fix is to not show the "extraWindow" immediately from the QML file,
but to postpone displaying the "extraWindow" to after we have verified
that the "view" has become active.
Change-Id: Ic008a332a736a3b7ab29ad9b2bfeb1eef0d7c19d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquickwindow/data/windowattached.qml | 1 | ||||
-rw-r--r-- | tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/quick/qquickwindow/data/windowattached.qml b/tests/auto/quick/qquickwindow/data/windowattached.qml index 9d61a02452..66083db428 100644 --- a/tests/auto/quick/qquickwindow/data/windowattached.qml +++ b/tests/auto/quick/qquickwindow/data/windowattached.qml @@ -19,7 +19,6 @@ Rectangle { property Window extraWindow: Window { objectName: "extraWindow" title: "extra window" - visible: true Text { objectName: "extraWindowText" anchors.centerIn: parent diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 7ee9db61f8..da1373e11b 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -2200,6 +2200,7 @@ void tst_qquickwindow::attachedProperty() QQuickWindow *innerWindow = view.rootObject()->findChild<QQuickWindow*>("extraWindow"); QVERIFY(innerWindow); + innerWindow->show(); innerWindow->requestActivate(); QVERIFY(QTest::qWaitForWindowActive(innerWindow)); |