From f2d3a486933cd3cb71b60ee27af53017e3a958bb Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 28 Apr 2016 21:35:07 +0200 Subject: Popup: emit opened() when fully opened Opening sequence: aboutToShow() -> visibleChanged() -> enter transition -> opened() Closing sequence: aboutToHide() -> exit transition -> visibleChanged() -> closed() Change-Id: If1a97f0d3cbc1dad0e1b1ceade4b807a9bff122e Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_popup.qml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml index b28a31e8..f5b9398c 100644 --- a/tests/auto/controls/data/tst_popup.qml +++ b/tests/auto/controls/data/tst_popup.qml @@ -955,22 +955,32 @@ TestCase { signalName: "closed" } + Component { + id: pausePopup + Popup { + enter: Transition { PauseAnimation { duration: 200 } } + exit: Transition { PauseAnimation { duration: 200 } } + } + } + function test_openedClosed() { - var control = popupControl.createObject(testCase) + var control = pausePopup.createObject(testCase) verify(control) openedSpy.target = control closedSpy.target = control control.open() - tryCompare(control, "visible", true) - compare(openedSpy.count, 1) + compare(control.visible, true) + compare(openedSpy.count, 0) + tryCompare(openedSpy, "count", 1) compare(closedSpy.count, 0) control.close() - tryCompare(control, "visible", false) compare(openedSpy.count, 1) - compare(closedSpy.count, 1) + compare(closedSpy.count, 0) + tryCompare(closedSpy, "count", 1) + compare(control.visible, false) control.destroy() } -- cgit v1.2.3