@@ -159,6 +159,18 @@ Item {
159159 target: LauncherModel
160160 }
161161
162+ Item {
163+ id: fakeDismissTimer
164+ property bool running: false
165+ signal triggered
166+
167+ function stop() {
168+ }
169+
170+ function restart() {
171+ }
172+ }
173+
162174 UnityTestCase {
163175 id: testCase
164176 name: "Launcher"
@@ -177,6 +189,11 @@ Item {
177189 launcherLoader.active = true;
178190 }
179191 function init() {
192+ var panel = findChild(launcher, "launcherPanel");
193+ verify(!!panel);
194+
195+ panel.dismissTimer = fakeDismissTimer;
196+
180197 // Make sure we don't start the test with the mouse hovering the launcher
181198 mouseMove(root, root.width, root.height / 2);
182199
@@ -216,11 +233,6 @@ Item {
216233 }
217234
218235 function revealByEdgePush() {
219− // make the dismissTimer interval very big temporarily
220− var dismissTimer = findInvisibleChild(launcher, "dismissTimer");
221− var oldInterval = dismissTimer.interval;
222− dismissTimer.interval = 100000;
223−
224236 // Place the mouse against the window/screen edge and push beyond the barrier threshold
225237 mouseMove(root, 1, root.height / 2);
226238 launcher.pushEdge(EdgeBarrierSettings.pushThreshold * 1.1);
@@ -231,15 +243,6 @@ Item {
231243 // wait until it gets fully extended
232244 tryCompare(panel, "x", 0);
233245 tryCompare(launcher, "state", "visibleTemporary");
234−
235− // move the mouse a bit, this should not be needed but without it
236− // the mouse areas do not realize their containsMouse have changed
237− // i've tested in real life without moving the mouse at all and it works
238− // so it seems to be a test-only issue
239− mouseMove(root, 2, root.height / 2);
240−
241− // now that the launcher is out, bring the interval back
242− dismissTimer.interval = oldInterval;
243246 }
244247
245248 function waitUntilLauncherDisappears() {
@@ -906,15 +909,13 @@ Item {
906909 revealByEdgePush();
907910 compare(launcher.state, "visibleTemporary");
908911
909− // wait three times the dismiss timer to check the launcher still shown
910− // because the mouse is still over the launcher
911− var dismissTimer = findInvisibleChild(launcher, "dismissTimer");
912− wait(dismissTimer.interval * 3);
913− compare(panel.x, 0);
914−
915912 // Now move the mouse away and make sure it hides in less than a second
916913 mouseMove(root, root.width, root.height / 2)
917914
915+ // trigger the hide timer
916+ fakeDismissTimer.triggered();
917+ tryCompare(panel, "x", 0);
918+
918919 tryCompare(launcher, "state", "", 1000, "Launcher didn't hide after moving mouse away from it");
919920 waitUntilLauncherDisappears();
920921 }