@@ -211,6 +211,7 @@ Item {
211 unlockAllModemsSpy.clear()
211 unlockAllModemsSpy.clear()
212 LightDM.Greeter.authenticate(""); // reset greeter
212 LightDM.Greeter.authenticate(""); // reset greeter
213 Wizard.System.wizardEnabled = false;
213 Wizard.System.wizardEnabled = false;
214+ AccountsService.demoEdges = false;
215 // reload our test subject to get it in a fresh state once again
216 // reload our test subject to get it in a fresh state once again
216 startShell();
217 startShell();
@@ -751,6 +752,35 @@ Item {
751 compare(unlockAllModemsSpy.count, 1);
752 compare(unlockAllModemsSpy.count, 1);
755+ function test_wizardEarlyExit() {
756+ Wizard.System.wizardEnabled = true;
757+ AccountsService.demoEdges = true;
758+ var wizard = findChild(shell, "wizard");
759+ var tutorial = findChild(shell, "tutorial");
760+ tryCompare(wizard, "active", true);
761+ tryCompare(tutorial, "running", true);
762+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
764+ // Make sure we stay running when nothing focused (can happen for
765+ // a moment when we restart the dash after switching language)
766+ ApplicationManager.stopApplication("unity8-dash");
767+ tryCompare(ApplicationManager, "focusedApplicationId", "");
768+ compare(wizard.shown, true);
769+ compare(tutorial.running, true);
771+ // And make sure we stay running when dash focused again
772+ ApplicationManager.startApplication("unity8-dash");
773+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
774+ compare(wizard.shown, true);
775+ compare(tutorial.running, true);
777+ // And make sure we stop when something else is focused
778+ ApplicationManager.startApplication("gallery-app");
779+ tryCompare(ApplicationManager, "focusedApplicationId", "gallery-app");
780+ compare(wizard.shown, false);
781+ compare(tutorial.running, false);
754 function test_tapOnRightEdgeReachesApplicationSurface() {
784 function test_tapOnRightEdgeReachesApplicationSurface() {
755 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
785 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
756 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
786 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;