on xenial help sign in
add a test for window (decoration) dragging using different mouse buttons
commit4e2fad4ce8ab6e8eb9c48acb9ccc92c5cc3f3bb7 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 15 Jun 2016, 18:54 (10 years ago) parent770ce2b
1 file changed+22
tests/qmltests/Stages/tst_DesktopStage.qml+22
tests/qmltests/Stages/tst_DesktopStage.qml+22
@@ -696,5 +696,27 @@ Item {
696696
697697 tryCompare(mouseEaterSpy, "count", 0);
698698 }
699+
700+ function test_canMoveWindowWithLeftMouseButtonOnly_data() {
701+ return [
702+ {tag: "left mouse button", button: Qt.LeftButton },
703+ {tag: "right mouse button", button: Qt.RightButton },
704+ {tag: "middle mouse button", button: Qt.MiddleButton }
705+ ]
706+ }
707+
708+ function test_canMoveWindowWithLeftMouseButtonOnly(data) {
709+ var appDelegate = startApplication("dialer-app");
710+ verify(appDelegate);
711+
712+ var posBefore = Qt.point(appDelegate.x, appDelegate.y);
713+
714+ mousePress(appDelegate, appDelegate.width / 2, units.gu(1), data.button);
715+ mouseMove(appDelegate, appDelegate.width / 2, -units.gu(100), undefined /* delay */, data.button);
716+
717+ var posAfter = Qt.point(appDelegate.x, appDelegate.y);
718+
719+ tryCompareFunction(function(){return posBefore == posAfter;}, data.button !== Qt.LeftButton ? true : false);
720+ }
699721 }
700722}