aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qquickpopup/tst_qquickpopup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qquickpopup/tst_qquickpopup.cpp')
-rw-r--r--tests/auto/qquickpopup/tst_qquickpopup.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qquickpopup/tst_qquickpopup.cpp b/tests/auto/qquickpopup/tst_qquickpopup.cpp
index c36edd6d..7da20c37 100644
--- a/tests/auto/qquickpopup/tst_qquickpopup.cpp
+++ b/tests/auto/qquickpopup/tst_qquickpopup.cpp
@@ -82,6 +82,7 @@ private slots:
void cursorShape();
void componentComplete();
void closeOnEscapeWithNestedPopups();
+ void closeOnEscapeWithVisiblePopup();
void enabled();
void orientation_data();
void orientation();
@@ -1020,6 +1021,21 @@ void tst_QQuickPopup::closeOnEscapeWithNestedPopups()
QCOMPARE(stackView->depth(), 1);
}
+void tst_QQuickPopup::closeOnEscapeWithVisiblePopup()
+{
+ QQuickApplicationHelper helper(this, QStringLiteral("closeOnEscapeWithVisiblePopup.qml"));
+ QQuickWindow *window = helper.window;
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
+
+ QQuickPopup *popup = window->findChild<QQuickPopup *>("popup");
+ QVERIFY(popup);
+ QTRY_VERIFY(popup->isOpened());
+
+ QTest::keyClick(window, Qt::Key_Escape);
+ QTRY_VERIFY(!popup->isVisible());
+}
+
void tst_QQuickPopup::enabled()
{
QQuickPopup popup;