summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2023-12-18 18:53:01 +0100
committerAxel Spoerl <axel.spoerl@qt.io>2023-12-20 17:16:53 +0100
commit599328845c7e77bc7b4fd5b4f2de000bb463a814 (patch)
treeb14f1b9e547571bea2c0f8a3136fe58b9f5134c9 /tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
parent09eb99f0116b459a9ce5f720ee1a6d9715f157ad (diff)
Stabilize tst_QMessageBox::hideNativeByDestruction()
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ø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp')
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp2
1 files changed, 1 insertions, 1 deletions
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