diff options
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 040ad17c74..1d1b0a318a 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -10138,6 +10138,8 @@ void tst_QWidget::enterLeaveOnWindowShowHide() secondary->show(); if (!QTest::qWaitForWindowExposed(secondary)) QEXPECT_FAIL("", "Secondary window failed to show, test will fail", Abort); + if (secondaryWindowType == Qt::Dialog && QGuiApplication::platformName() == "windows") + QTest::qWait(250); // on Windows, we have to wait for fade-in effects } }; @@ -10164,15 +10166,16 @@ void tst_QWidget::enterLeaveOnWindowShowHide() QTest::mouseClick(&widget, Qt::LeftButton, {}, widget.mapFromGlobal(cursorPos)); ++expectedLeave; - QTRY_COMPARE_WITH_TIMEOUT(widget.numLeaveEvents, expectedLeave, 500); + QTRY_COMPARE_WITH_TIMEOUT(widget.numLeaveEvents, expectedLeave, 1000); QVERIFY(!widget.underMouse()); + QTRY_VERIFY(QApplication::activeModalWidget() || QApplication::activePopupWidget()); if (QApplication::activeModalWidget()) QApplication::activeModalWidget()->close(); else if (QApplication::activePopupWidget()) QApplication::activePopupWidget()->close(); ++expectedEnter; // Use default timeout, the test is flaky on Windows otherwise. - QVERIFY(QTest::qWaitFor([&]{ return widget.numEnterEvents >= expectedEnter; })); + QTRY_VERIFY(widget.numEnterEvents >= expectedEnter); // When a modal dialog closes we might get more than one enter event on macOS. // This seems to depend on timing, so we tolerate that flakiness for now. if (widget.numEnterEvents > expectedEnter && QGuiApplication::platformName() == "cocoa") |