@@ -957,6 +957,37 @@ Rectangle {
957 compare(unlockAllModemsSpy.count, 1);
957 compare(unlockAllModemsSpy.count, 1);
960+ function test_wizardEarlyExit() {
961+ Wizard.System.wizardEnabled = true;
962+ AccountsService.demoEdges = true;
965+ var wizard = findChild(shell, "wizard");
966+ var tutorial = findChild(shell, "tutorial");
967+ tryCompare(wizard, "active", true);
968+ tryCompare(tutorial, "running", true);
969+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
971+ // Make sure we stay running when nothing focused (can happen for
972+ // a moment when we restart the dash after switching language)
973+ ApplicationManager.stopApplication("unity8-dash");
974+ tryCompare(ApplicationManager, "focusedApplicationId", "");
975+ compare(wizard.shown, true);
976+ compare(tutorial.running, true);
978+ // And make sure we stay running when dash focused again
979+ ApplicationManager.startApplication("unity8-dash");
980+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
981+ compare(wizard.shown, true);
982+ compare(tutorial.running, true);
984+ // And make sure we stop when something else is focused
985+ ApplicationManager.startApplication("gallery-app");
986+ tryCompare(ApplicationManager, "focusedApplicationId", "gallery-app");
987+ compare(wizard.shown, false);
988+ compare(tutorial.running, false);
960 function test_tapOnRightEdgeReachesApplicationSurface() {
991 function test_tapOnRightEdgeReachesApplicationSurface() {
961 loadShell("phone");
992 loadShell("phone");
962 swipeAwayGreeter();
993 swipeAwayGreeter();