diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-11-04 10:21:53 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-11-04 10:21:53 +0100 |
commit | a4317a8f2732213d9d804363918e12b39e308ce2 (patch) | |
tree | 2630ad88e4ad2ad2b709c71bf67469dd69af5a06 /tests/auto/qquickpopup | |
parent | 9898744e2ea17e805da559faeb677c9f5bbe080f (diff) | |
parent | 5c1aa494e95b2945500e3c3e62240dd60e7190d6 (diff) |
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
.qmake.conf
Change-Id: Ibf7cf09570e73ad2f314e9ce7acf1c766ac3f332
Diffstat (limited to 'tests/auto/qquickpopup')
-rw-r--r-- | tests/auto/qquickpopup/data/closeOnEscapeWithVisiblePopup.qml | 16 | ||||
-rw-r--r-- | tests/auto/qquickpopup/tst_qquickpopup.cpp | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qquickpopup/data/closeOnEscapeWithVisiblePopup.qml b/tests/auto/qquickpopup/data/closeOnEscapeWithVisiblePopup.qml new file mode 100644 index 00000000..b9606eb2 --- /dev/null +++ b/tests/auto/qquickpopup/data/closeOnEscapeWithVisiblePopup.qml @@ -0,0 +1,16 @@ +import QtQuick 2.13 +import QtQuick.Window 2.13 +import QtQuick.Controls 2.13 + +Window { + width: 400 + height: 400 + Popup { + objectName: "popup" + visible: true + width: 200 + height: 200 + anchors.centerIn: parent + closePolicy: Popup.CloseOnEscape + } +} 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; |