diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-11-19 13:09:01 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-11-19 15:42:42 +0100 |
commit | 49b1e3ff2ac20d8aa8b3889fc76ab4e6907817fd (patch) | |
tree | f4b17fa4edc60067aa1f894575d960cd83c5b302 | |
parent | 73cd5c4aa762f15da3e0e1d4a4aabb1d5ddad762 (diff) |
Attempt to stabilise tst_qquickpopup::closeOnEscapeWithVisiblePopup()
It's flaky on openSUSE. Whenever it would fail, the activeFocusItem
was always null, so check for that before doing the key press.
Change-Id: Ib31d4869902b40424b3994d1d468a3eace8847f0
Fixes: QTBUG-80164
Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r-- | tests/auto/qquickpopup/tst_qquickpopup.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qquickpopup/tst_qquickpopup.cpp b/tests/auto/qquickpopup/tst_qquickpopup.cpp index 7da20c37..b5c59e02 100644 --- a/tests/auto/qquickpopup/tst_qquickpopup.cpp +++ b/tests/auto/qquickpopup/tst_qquickpopup.cpp @@ -1026,12 +1026,13 @@ void tst_QQuickPopup::closeOnEscapeWithVisiblePopup() QQuickApplicationHelper helper(this, QStringLiteral("closeOnEscapeWithVisiblePopup.qml")); QQuickWindow *window = helper.window; window->show(); - QVERIFY(QTest::qWaitForWindowExposed(window)); + QVERIFY(QTest::qWaitForWindowActive(window)); QQuickPopup *popup = window->findChild<QQuickPopup *>("popup"); QVERIFY(popup); QTRY_VERIFY(popup->isOpened()); + QTRY_VERIFY(window->activeFocusItem()); QTest::keyClick(window, Qt::Key_Escape); QTRY_VERIFY(!popup->isVisible()); } |