diff options
author | Filippo Cucchetto <filippocucchetto@gmail.com> | 2015-08-17 15:46:45 +0200 |
---|---|---|
committer | Filippo Cucchetto <filippocucchetto@gmail.com> | 2015-08-25 08:59:41 +0000 |
commit | 0b6ed7641e2dc15211dcddc048fef548390c7b7b (patch) | |
tree | 7c4619af465514c4cc978062608fe64a123b33d3 /tests | |
parent | 388da47ea0b8dea55e52f623531c0f07b543b460 (diff) | |
download | qtquickcontrols-0b6ed7641e2dc15211dcddc048fef548390c7b7b.tar.gz |
MenuBar added test for close on Escape pressed
Pressing the escape key when a menu is currently opened inside the
menubar should close it. A new test is added for checking this behavior.
Change-Id: I446cd4f22e1f8d756d89bb20712e354a6d7fe909
Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_menubar.qml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_menubar.qml b/tests/auto/controls/data/tst_menubar.qml index c71cdc33..e268b059 100644 --- a/tests/auto/controls/data/tst_menubar.qml +++ b/tests/auto/controls/data/tst_menubar.qml @@ -106,4 +106,24 @@ TestCase { tryCompare(fileMenu, "__popupVisible", false) window.destroy() } + + function test_closeOnEscapePressed() { + if (Qt.platform.os === "osx") + skip("MenuBar cannot be reliably tested on OS X") + + var window = windowComponent.createObject() + waitForRendering(window.contentItem) + var fileMenu = findChild(window, "fileMenu") + verify(fileMenu) + // Click menu should open + compare(fileMenu.__popupVisible, false) + mouseClick(fileMenu.__visualItem) + tryCompare(fileMenu, "__popupVisible", true) + // wait until popup is visible + tryCompare(fileMenu.__contentItem, "status", Loader.Ready) + waitForRendering(fileMenu.__contentItem.item) + // Pressing escape should close the popup + keyPress(Qt.Key_Escape) + compare(fileMenu.__popupVisible, false) + } } |