diff options
Diffstat (limited to 'tests/auto/widgets/kernel/qwidget')
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index aca40103df..27cf884fd5 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -12253,10 +12253,19 @@ protected: void tst_QWidget::deleteWindowInCloseEvent() { - // Just checking if closing this widget causes a crash + QSignalSpy quitSpy(qApp, &QGuiApplication::lastWindowClosed); + + // Closing this widget should not cause a crash auto widget = new DeleteOnCloseEventWidget; - widget->close(); - QVERIFY(true); + widget->show(); + QVERIFY(QTest::qWaitForWindowExposed(widget)); + QTimer::singleShot(0, widget, [&]{ + widget->close(); + }); + QApplication::exec(); + + // It should still result in a single lastWindowClosed emit + QCOMPARE(quitSpy.count(), 1); } /*! |