on xenial help sign in
Launcher tests: Ensure the quickList is ready
commit45718b8198fe3e8bf42f8fa4cda8177146dcc14d authorDalton Durst <dalton@ubports.com> dateMon 27 May 2019, 19:07 (7 years ago) parent7ff365e
2 files changed+9−2
qml/Launcher/LauncherPanel.qml+6−1 tests/qmltests/Launcher/tst_Launcher.qml+3−1
qml/Launcher/LauncherPanel.qml+6−1
@@ -665,8 +665,13 @@ Rectangle {
665665 rotation: root.rotation
666666 aspect: UbuntuShape.Flat
667667
668+ // Denotes that the shape is not animating, to prevent race conditions during testing
669+ readonly property bool ready: (visible && (!quickListShapeOpacityFade.running))
670+
668671 Behavior on opacity {
669− UbuntuNumberAnimation {}
672+ UbuntuNumberAnimation {
673+ id: quickListShapeOpacityFade
674+ }
670675 }
671676
672677 source: ShaderEffectSource {
tests/qmltests/Launcher/tst_Launcher.qml+3−1
@@ -1496,7 +1496,7 @@ Rectangle {
14961496 launcher.available = true;
14971497 }
14981498
1499− function test_hoverOnEdgeBarrerPreventsHiding() {
1499+ function test_hoverOnEdgeBarrierPreventsHiding() {
15001500 revealByEdgePush();
15011501
15021502 // Make sure the mouse is on the very left edge (on top of the barrier)
@@ -1555,6 +1555,7 @@ Rectangle {
15551555 dragLauncherIntoView();
15561556 var clickedItem = findChild(launcher, "launcherDelegate5")
15571557 var quickList = findChild(launcher, "quickList")
1558+ var quickListShape = findChild(launcher, "quickListShape");
15581559
15591560 // Initial state
15601561 tryCompare(quickList, "state", "")
@@ -1563,6 +1564,7 @@ Rectangle {
15631564 mouseClick(clickedItem, clickedItem.width / 2, clickedItem.height / 2, Qt.RightButton)
15641565 tryCompare(quickList, "state", "open");
15651566 tryCompare(quickList, "selectedIndex", -1);
1567+ tryVerify(function() {return quickListShape.ready});
15661568
15671569 var qEntry = findChild(launcher, "quickListEntry0");
15681570 mouseMove(qEntry, qEntry.width / 2 , qEntry.height / 2, 10);