@@ -140,8 +140,6 @@ Item {
140 stage = findChild(shell, "stage");
140 stage = findChild(shell, "stage");
141 topLevelSurfaceList = findInvisibleChild(shell, "topLevelSurfaceList");
141 topLevelSurfaceList = findInvisibleChild(shell, "topLevelSurfaceList");
142 verify(topLevelSurfaceList);
142 verify(topLevelSurfaceList);
144− startApplication("unity8-dash");
147 function cleanup() {
145 function cleanup() {
@@ -288,7 +286,7 @@ Item {
288 var greeter = findChild(shell, "greeter");
286 var greeter = findChild(shell, "greeter");
289 var emergencyButton = findChild(greeter, "emergencyCallLabel");
287 var emergencyButton = findChild(greeter, "emergencyCallLabel");
290 tap(emergencyButton)
288 tap(emergencyButton)
291− tryCompare(topLevelSurfaceList, "count", 2);
289+ tryCompare(topLevelSurfaceList, "count", 1);
292 waitUntilAppWindowIsFullyLoaded(dialerSurfaceId);
290 waitUntilAppWindowIsFullyLoaded(dialerSurfaceId);
294 tryCompare(greeter, "shown", false);
292 tryCompare(greeter, "shown", false);
@@ -416,6 +414,8 @@ Item {
416 // - Should be back in normal dialer
414 // - Should be back in normal dialer
417 // (we've had a bug where we locked screen in this case)
415 // (we've had a bug where we locked screen in this case)
417+ startApplication("gallery-app");
419 var greeter = findChild(shell, "greeter");
419 var greeter = findChild(shell, "greeter");
420 var panel = findChild(shell, "panel");
420 var panel = findChild(shell, "panel");
@@ -427,8 +427,8 @@ Item {
427 tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app");
427 tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app");
428 callManager.foregroundCall = phoneCall;
428 callManager.foregroundCall = phoneCall;
430− ApplicationManager.requestFocusApplication("unity8-dash");
430+ ApplicationManager.requestFocusApplication("gallery-app");
431− tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
431+ tryCompare(ApplicationManager, "focusedApplicationId", "gallery-app");
432 var callHint = findChild(panel, "callHint");
432 var callHint = findChild(panel, "callHint");
433 tryCompare(callHint, "visible", true);
433 tryCompare(callHint, "visible", true);
434 wait(10000)
434 wait(10000)
@@ -528,5 +528,31 @@ Item {
529 tryCompare(launcher, "state", "drawer");
529 tryCompare(launcher, "state", "drawer");
532+ /* Regression test, https://github.com/ubports/ubuntu-touch/issues/1178
533+ When all apps closed while the Greeter was shown, the Launcher would
534+ appear over the Greeter. This was caused by logic that would normally
535+ cause the Launcher to be shown over the empty Background. */
536+ function test_launcherShowCulledWhenLocked() {
537+ var launcher = findChild(shell, "launcher");
539+ // Ensure the Launcher is sane
540+ touchFlick(shell, units.gu(.5), shell.height / 2, units.gu(10), shell.height / 2);
541+ tryCompare(launcher, "state", "visible");
543+ tryCompare(launcher, "state", "");
545+ console.log("I AM LOGGING NOW");
546+ console.log(ApplicationManager.count);
548+ // Start and kill an app to cause the Launcher to be triggered (in error state)
549+ startApplication("gallery-app");
550+ tryCompare(ApplicationManager, "count", 1);
551+ ApplicationManager.stopApplication("gallery-app");
552+ tryCompare(ApplicationManager, "count", 0);
554+ // Make sure that the error state didn't happen
555+ tryCompare(launcher, "state", "");