on xenial help sign in
Launcher tests: Ensure the quickList is ready
45718b8Dalton Durst
qml/Launcher/LauncherPanel.qml+6−1
@@ -665,8 +665,13 @@ Rectangle {
665 rotation: root.rotation
665 rotation: root.rotation
666 aspect: UbuntuShape.Flat
666 aspect: UbuntuShape.Flat
667
667
668+ // Denotes that the shape is not animating, to prevent race conditions during testing
669+ readonly property bool ready: (visible && (!quickListShapeOpacityFade.running))
670+
668 Behavior on opacity {
671 Behavior on opacity {
669− UbuntuNumberAnimation {}
672+ UbuntuNumberAnimation {
673+ id: quickListShapeOpacityFade
674+ }
670 }
675 }
671
676
672 source: ShaderEffectSource {
677 source: ShaderEffectSource {
tests/qmltests/Launcher/tst_Launcher.qml+3−1
@@ -1496,7 +1496,7 @@ Rectangle {
1496 launcher.available = true;
1496 launcher.available = true;
1497 }
1497 }
1498
1498
1499− function test_hoverOnEdgeBarrerPreventsHiding() {
1499+ function test_hoverOnEdgeBarrierPreventsHiding() {
1500 revealByEdgePush();
1500 revealByEdgePush();
1501
1501
1502 // Make sure the mouse is on the very left edge (on top of the barrier)
1502 // Make sure the mouse is on the very left edge (on top of the barrier)
@@ -1555,6 +1555,7 @@ Rectangle {
1555 dragLauncherIntoView();
1555 dragLauncherIntoView();
1556 var clickedItem = findChild(launcher, "launcherDelegate5")
1556 var clickedItem = findChild(launcher, "launcherDelegate5")
1557 var quickList = findChild(launcher, "quickList")
1557 var quickList = findChild(launcher, "quickList")
1558+ var quickListShape = findChild(launcher, "quickListShape");
1558
1559
1559 // Initial state
1560 // Initial state
1560 tryCompare(quickList, "state", "")
1561 tryCompare(quickList, "state", "")
@@ -1563,6 +1564,7 @@ Rectangle {
1563 mouseClick(clickedItem, clickedItem.width / 2, clickedItem.height / 2, Qt.RightButton)
1564 mouseClick(clickedItem, clickedItem.width / 2, clickedItem.height / 2, Qt.RightButton)
1564 tryCompare(quickList, "state", "open");
1565 tryCompare(quickList, "state", "open");
1565 tryCompare(quickList, "selectedIndex", -1);
1566 tryCompare(quickList, "selectedIndex", -1);
1567+ tryVerify(function() {return quickListShape.ready});
1566
1568
1567 var qEntry = findChild(launcher, "quickListEntry0");
1569 var qEntry = findChild(launcher, "quickListEntry0");
1568 mouseMove(qEntry, qEntry.width / 2 , qEntry.height / 2, 10);
1570 mouseMove(qEntry, qEntry.width / 2 , qEntry.height / 2, 10);