diff options
Diffstat (limited to 'tests/auto/qquickpopup/tst_qquickpopup.cpp')
-rw-r--r-- | tests/auto/qquickpopup/tst_qquickpopup.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/auto/qquickpopup/tst_qquickpopup.cpp b/tests/auto/qquickpopup/tst_qquickpopup.cpp index 636b2b21..4d238663 100644 --- a/tests/auto/qquickpopup/tst_qquickpopup.cpp +++ b/tests/auto/qquickpopup/tst_qquickpopup.cpp @@ -89,6 +89,8 @@ private slots: void disabledPalette(); void disabledParentPalette(); void countChanged(); + void toolTipCrashOnClose(); + void setOverlayParentToNull(); }; void tst_QQuickPopup::initTestCase() @@ -1187,6 +1189,46 @@ void tst_QQuickPopup::countChanged() QVERIFY(window->setProperty("isModel1", false)); QTRY_COMPARE(window->property("count").toInt(), 2); } + +// QTBUG-73243 +void tst_QQuickPopup::toolTipCrashOnClose() +{ + QQuickApplicationHelper helper(this, "toolTipCrashOnClose.qml"); + + QQuickWindow *window = helper.window; + window->show(); + // TODO: Using ignoreMessage() fails in CI with macOS for release builds, + // so for now we let the warning through. +// QTest::ignoreMessage(QtWarningMsg, "ShaderEffectSource: 'recursive' must be set to true when rendering recursively."); + QVERIFY(QTest::qWaitForWindowActive(window)); + + QTest::mouseMove(window, QPoint(window->width() / 2, window->height() / 2)); + QTRY_VERIFY(window->property("toolTipOpened").toBool()); + + QVERIFY(window->close()); + // Shouldn't crash. +} + +void tst_QQuickPopup::setOverlayParentToNull() +{ + QQuickApplicationHelper helper(this, "toolTipCrashOnClose.qml"); + + QQuickWindow *window = helper.window; + window->show(); + // TODO: Using ignoreMessage() fails in CI with macOS for release builds, + // so for now we let the warning through. +// QTest::ignoreMessage(QtWarningMsg, "ShaderEffectSource: 'recursive' must be set to true when rendering recursively."); + QVERIFY(QTest::qWaitForWindowActive(window)); + + QVERIFY(QMetaObject::invokeMethod(window, "nullifyOverlayParent")); + + QTest::mouseMove(window, QPoint(window->width() / 2, window->height() / 2)); + QTRY_VERIFY(window->property("toolTipOpened").toBool()); + + QVERIFY(window->close()); + // While nullifying the overlay parent doesn't make much sense, it shouldn't crash. +} + QTEST_QUICKCONTROLS_MAIN(tst_QQuickPopup) #include "tst_qquickpopup.moc" |