on xenial help sign in
add a test for RMB menu over launcher items
fe2e279Lukáš Tinkl
qml/Launcher/LauncherPanel.qml+1−1
@@ -298,7 +298,7 @@ Rectangle {
298 property int draggedIndex: -1
298 property int draggedIndex: -1
299 property var selectedItem
299 property var selectedItem
300 property bool preDragging: false
300 property bool preDragging: false
301− property bool dragging: selectedItem !== undefined && selectedItem !== null && selectedItem.dragging
301+ property bool dragging: !!selectedItem && selectedItem.dragging
302 property bool postDragging: false
302 property bool postDragging: false
303 property int startX
303 property int startX
304 property int startY
304 property int startY
tests/qmltests/Launcher/tst_Launcher.qml+22
@@ -623,6 +623,28 @@ Item {
623 tryCompare(quickList, "state", "");
623 tryCompare(quickList, "state", "");
624 }
624 }
625
625
626+ function test_quickListMenuOnRMB() {
627+ dragLauncherIntoView();
628+ var clickedItem = findChild(launcher, "launcherDelegate5")
629+ var quickList = findChild(launcher, "quickList")
630+ var quickListShape = findChild(launcher, "quickListShape")
631+ var dndArea = findChild(launcher, "dndArea");
632+
633+ // Initial state
634+ tryCompare(quickListShape, "visible", false)
635+
636+ // Doing RMB click
637+ mouseClick(clickedItem, clickedItem.width / 2, clickedItem.height / 2, Qt.RightButton)
638+ tryCompare(quickListShape, "visible", true)
639+ verify(quickList, "state", "open")
640+ verify(dndArea, "dragging", false)
641+
642+ // Click somewhere in the empty space to dismiss the quicklist
643+ mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));
644+ tryCompare(quickListShape, "visible", false);
645+ verify(quickList, "state", "")
646+ }
647+
626 function test_revealByHover() {
648 function test_revealByHover() {
627 var panel = findChild(launcher, "launcherPanel");
649 var panel = findChild(launcher, "launcherPanel");
628 verify(!!panel);
650 verify(!!panel);