on xenial help sign in
Exercise swipe-to-dismiss functionality in notification qmltest.
commit02c69143106a02e41be8ad06540df5ac2d066bb5 authorMirco Müller <mirco.mueller@ubuntu.com> dateMon 15 Sep 2014, 17:47 (12 years ago) parent61bf9a3
2 files changed+15−1
qml/Notifications/Notification.qml−1 tests/qmltests/Notifications/tst_Notifications.qml+15
qml/Notifications/Notification.qml−1
@@ -37,7 +37,6 @@ Item {
3737 property var notification
3838 property color color
3939 property bool fullscreen: false
40− //property bool draggable: (notification.type == Notification.SnapDecision && state == "contracted") || notification.type == Notification.Interactive
4140 property bool draggable: state == "contracted" || notification.type !== Notification.Confirmation
4241 property int maxHeight
4342 property int margins
tests/qmltests/Notifications/tst_Notifications.qml+15
@@ -33,6 +33,10 @@ Row {
3333 function invokeAction(actionId) {
3434 mockModel.actionInvoked(actionId)
3535 }
36+
37+ function close() {
38+ mockModel.remove(1)
39+ }
3640 }
3741 }
3842
@@ -482,6 +486,17 @@ Row {
482486 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
483487 }
484488 }
489+
490+ // swipe-to-dismiss check
491+ if (data.type !== Notification.SnapDecision && notification.state !== "expanded") {
492+ var before = mockModel.count
493+ var dragStart = notification.width * 0.25;
494+ var dragEnd = notification.width;
495+ var dragY = notification.height / 2;
496+ touchFlick(notification, dragStart, dragY, dragEnd, dragY)
497+ waitForRendering(notification)
498+ tryCompare(mockModel, "count", before - 1)
499+ }
485500 }
486501 }
487502}