From 599328845c7e77bc7b4fd5b4f2de000bb463a814 Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Mon, 18 Dec 2023 18:53:01 +0100 Subject: Stabilize tst_QMessageBox::hideNativeByDestruction() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test was flaky, because of qWaitForWindowActive() after show(). It is not guaranteed, that a window has focus after show(). Use qWaitForWindowExposed() instead. Task-number: QTBUG-118489 Pick-to: 6.7 6.6 6.5 Change-Id: I1eb8a73f2beafec00c4a6f6b34bfd36a8d6e4d93 Reviewed-by: Tor Arne Vestbø --- tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp index 74ac6611a5..1a77aba9db 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp @@ -796,7 +796,7 @@ void tst_QMessageBox::hideNativeByDestruction() // Make it application modal so that we don't end up with a sheet on macOS dialog->setWindowModality(Qt::ApplicationModal); window.show(); - QVERIFY(QTest::qWaitForWindowActive(&window)); + QVERIFY(QTest::qWaitForWindowExposed(&window)); dialog->open(); // We test that the dialog opens and closes by watching the activation of the -- cgit v1.2.3