diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-05-31 18:44:57 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-06-06 10:23:47 +0000 |
commit | 4339a686c190605121a327f703e96dae8b9451d5 (patch) | |
tree | 8050a5495ac8131a74a07e2cb73a5a6c5913498e /tests | |
parent | 1981ed233f4f78073bba6977edbc7ffdfbb6d2cc (diff) |
Add Popup::opened
[ChangeLog][Controls][Popup] Added an "opened" boolean property that
holds whether a popup is fully open. That is, the popup is visible and
neither the enter nor exit transitions are running.
Change-Id: I18a1403be381c113fdbcc4211e267f68632984b7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_popup.qml | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml index bec50ad0..c8b3985c 100644 --- a/tests/auto/controls/data/tst_popup.qml +++ b/tests/auto/controls/data/tst_popup.qml @@ -1178,16 +1178,6 @@ TestCase { compare(child.ApplicationWindow.window, null) } - SignalSpy { - id: openedSpy - signalName: "opened" - } - - SignalSpy { - id: closedSpy - signalName: "closed" - } - Component { id: pausePopup Popup { @@ -1200,19 +1190,32 @@ TestCase { var control = createTemporaryObject(pausePopup, testCase) verify(control) - openedSpy.target = control - closedSpy.target = control + var openedSpy = createTemporaryObject(signalSpy, testCase, {target: control, signalName: "opened"}) + verify(openedSpy.valid) + var closedSpy = createTemporaryObject(signalSpy, testCase, {target: control, signalName: "closed"}) + verify(closedSpy.valid) + var openedChangeSpy = createTemporaryObject(signalSpy, testCase, {target: control, signalName: "openedChanged"}) + verify(openedChangeSpy.valid) control.open() compare(control.visible, true) + compare(control.opened, false) + compare(openedChangeSpy.count, 0) compare(openedSpy.count, 0) tryCompare(openedSpy, "count", 1) + compare(control.opened, true) + compare(openedChangeSpy.count, 1) compare(closedSpy.count, 0) control.close() + compare(control.visible, true) + compare(control.opened, false) + compare(openedChangeSpy.count, 2) compare(openedSpy.count, 1) compare(closedSpy.count, 0) tryCompare(closedSpy, "count", 1) + compare(control.opened, false) + compare(openedChangeSpy.count, 2) compare(control.visible, false) } |