From 49b1e3ff2ac20d8aa8b3889fc76ab4e6907817fd Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 19 Nov 2019 13:09:01 +0100 Subject: 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 --- tests/auto/qquickpopup/tst_qquickpopup.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/auto') 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("popup"); QVERIFY(popup); QTRY_VERIFY(popup->isOpened()); + QTRY_VERIFY(window->activeFocusItem()); QTest::keyClick(window, Qt::Key_Escape); QTRY_VERIFY(!popup->isVisible()); } -- cgit v1.2.3