@@ -267,10 +267,10 @@ Rectangle {
267 function init() {
267 function init() {
268 prepareShell();
268 prepareShell();
270− var tutorialLeft = findChild(shell, "tutorialLeft");
270+ var tutorialTop = findChild(shell, "tutorialTop");
271− var tutorialLeftTimer = findInvisibleChild(tutorialLeft, "tutorialLeftTimer");
271+ var tutorialTopTimer = findInvisibleChild(tutorialTop, "tutorialTopTimer");
272− tutorialLeftTimer.interval = 0;
272+ tutorialTopTimer.interval = 0;
273− tryCompare(tutorialLeft, "opacity", 1);
273+ tryCompare(tutorialTop, "opacity", 1);
276 function cleanup() {
276 function cleanup() {
@@ -308,7 +308,6 @@ Rectangle {
308 tryCompare(shell, "waitingOnGreeter", false); // reset by greeter when ready
308 tryCompare(shell, "waitingOnGreeter", false); // reset by greeter when ready
310 WindowStateStorage.clear();
310 WindowStateStorage.clear();
311− //topLevelSurfaceList.inputMethodSurface.setState(Mir.MinimizedState);
312 callManager.foregroundCall = null;
311 callManager.foregroundCall = null;
313 AccountsService.demoEdges = false;
312 AccountsService.demoEdges = false;
314 AccountsService.demoEdgesCompleted = [];
313 AccountsService.demoEdgesCompleted = [];
@@ -317,8 +316,6 @@ Rectangle {
317 LightDM.Greeter.hideGreeter();
316 LightDM.Greeter.hideGreeter();
319 stage = findChild(shell, "stage"); // from StageTestCase
318 stage = findChild(shell, "stage"); // from StageTestCase
321− startApplication("unity8-dash");
324 function loadShell(state) {
321 function loadShell(state) {
@@ -334,37 +331,25 @@ Rectangle {
334 tryCompareFunction(function() { return topLevelSurfaceList.inputMethodSurface !== null }, true);
331 tryCompareFunction(function() { return topLevelSurfaceList.inputMethodSurface !== null }, true);
337− function swipeAwayGreeter() {
334+ function openTutorialLeft() {
338− var coverPage = findChild(shell, "coverPage");
335+ var tutorialTopLoader = findChild(shell, "tutorialTopLoader");
339− tryCompare(coverPage, "showProgress", 1);
341− touchFlick(shell, halfWidth, halfHeight, shell.width, halfHeight);
343− // wait until the animation has finished
344− var greeter = findChild(shell, "greeter");
345− tryCompare(greeter, "required", false);
346− waitForRendering(greeter);
349− function openTutorialTop() {
350 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
336 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
351− var tutorialTop = findChild(shell, "tutorialTop");
337+ var tutorialLeft = findInvisibleChild(tutorialLeftLoader, "tutorialLeft");
352− var tutorialTopTimer = findInvisibleChild(tutorialTop, "tutorialTopTimer");
338+ var tutorialLeftTimer = findInvisibleChild(tutorialLeft, "tutorialLeftTimer");
354− tutorialTopTimer.interval = 1;
340+ tutorialLeftTimer.interval = 1;
355− AccountsService.demoEdgesCompleted = ["left"];
341+ AccountsService.demoEdgesCompleted = ["top"];
357− tryCompare(tutorialLeftLoader, "active", false);
343+ tryCompare(tutorialTopLoader, "active", false);
358− tryCompare(tutorialTop, "shown", true);
344+ tryCompare(tutorialLeft, "shown", true);
359− tryCompare(tutorialTop, "opacity", 1);
345+ tryCompare(tutorialLeft, "opacity", 1);
362 function openTutorialLeftLong() {
348 function openTutorialLeftLong() {
363 var tutorialLeftLong = findChild(shell, "tutorialLeftLong");
349 var tutorialLeftLong = findChild(shell, "tutorialLeftLong");
364 var tutorialLeftLongTimer = findChild(tutorialLeftLong, "tutorialLeftLongTimer");
350 var tutorialLeftLongTimer = findChild(tutorialLeftLong, "tutorialLeftLongTimer");
366− AccountsService.demoEdgesCompleted = ["left", "top"];
352+ AccountsService.demoEdgesCompleted = ["top", "left"];
367− ApplicationManager.startApplication("gallery-app");
369 tutorialLeftLongTimer.interval = 1;
354 tutorialLeftLongTimer.interval = 1;
370 tryCompare(tutorialLeftLong, "shown", true);
355 tryCompare(tutorialLeftLong, "shown", true);
@@ -372,21 +357,29 @@ Rectangle {
374 function openTutorialRight() {
359 function openTutorialRight() {
375− var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
360+ var tutorialLeftLongLoader = findChild(shell, "tutorialLeftLongLoader");
376 var tutorialRight = findChild(shell, "tutorialRight");
361 var tutorialRight = findChild(shell, "tutorialRight");
377 var tutorialRightTimer = findChild(tutorialRight, "tutorialRightTimer");
362 var tutorialRightTimer = findChild(tutorialRight, "tutorialRightTimer");
379− AccountsService.demoEdgesCompleted = ["left", "top", "left-long"];
364+ AccountsService.demoEdgesCompleted = ["top", "left", "left-long"];
380− ApplicationManager.startApplication("gallery-app");
381 ApplicationManager.startApplication("facebook-webapp");
365 ApplicationManager.startApplication("facebook-webapp");
382− ApplicationManager.startApplication("camera-app");
384− tryCompare(tutorialLeftLoader, "active", false);
367+ tryCompare(tutorialLeftLongLoader, "active", false);
385 tutorialRightTimer.interval = 1;
368 tutorialRightTimer.interval = 1;
386 tryCompare(tutorialRight, "shown", true);
369 tryCompare(tutorialRight, "shown", true);
387 tryCompare(tutorialRight, "opacity", 1);
370 tryCompare(tutorialRight, "opacity", 1);
373+ function longLeftSwipe() {
374+ // Perform a long enough swipe to cause the Drawer to appear
375+ var launcher = findChild(shell, "launcher");
376+ var startX = launcher.dragAreaWidth/2;
377+ var startY = launcher.height/2;
378+ touchFlick(launcher,
380+ startX+units.gu(35), startY);
390 function test_tutorialLeftEdges() {
383 function test_tutorialLeftEdges() {
391 var tutorial = findChild(shell, "tutorial");
384 var tutorial = findChild(shell, "tutorial");
392 var tutorialLeft = findChild(tutorial, "tutorialLeft");
385 var tutorialLeft = findChild(tutorial, "tutorialLeft");
@@ -394,6 +387,8 @@ Rectangle {
394 var stage = findChild(shell, "stage");
387 var stage = findChild(shell, "stage");
395 var panel = findChild(shell, "panel");
388 var panel = findChild(shell, "panel");
397 verify(tutorial.running);
392 verify(tutorial.running);
398 verify(tutorial.launcherEnabled);
393 verify(tutorial.launcherEnabled);
399 verify(!tutorial.spreadEnabled);
394 verify(!tutorial.spreadEnabled);
@@ -409,10 +404,12 @@ Rectangle {
409 var tutorialLeftLoader = findChild(tutorial, "tutorialLeftLoader");
404 var tutorialLeftLoader = findChild(tutorial, "tutorialLeftLoader");
410 var launcher = findChild(shell, "launcher");
405 var launcher = findChild(shell, "launcher");
412 touchFlick(shell, 0, halfHeight, halfWidth, halfHeight);
409 touchFlick(shell, 0, halfHeight, halfWidth, halfHeight);
414 tryCompare(tutorialLeftLoader, "shown", false);
411 tryCompare(tutorialLeftLoader, "shown", false);
415− tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
412+ tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left"]);
416 tryCompare(launcher, "state", "visible");
413 tryCompare(launcher, "state", "visible");
@@ -424,6 +421,8 @@ Rectangle {
424 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
421 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
425 var launcher = findChild(shell, "launcher");
422 var launcher = findChild(shell, "launcher");
427 // Confirm fade during drag
426 // Confirm fade during drag
428 touchFlick(shell, 0, halfHeight, launcher.panelWidth * 0.4, halfHeight, true, false);
427 touchFlick(shell, 0, halfHeight, launcher.panelWidth * 0.4, halfHeight, true, false);
429 // compare opacity with a bound rather than hard 0.6 because progress doesn't
428 // compare opacity with a bound rather than hard 0.6 because progress doesn't
@@ -445,55 +444,65 @@ Rectangle {
445 touchFlick(shell, 0, halfHeight, launcher.panelWidth * 0.9, halfHeight);
444 touchFlick(shell, 0, halfHeight, launcher.panelWidth * 0.9, halfHeight);
447 tryCompare(tutorialLeftLoader, "shown", false);
446 tryCompare(tutorialLeftLoader, "shown", false);
448− tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
447+ tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left"]);
449 tryCompare(launcher, "state", "visible");
448 tryCompare(launcher, "state", "visible");
452 function test_tutorialLeftLongFinish() {
451 function test_tutorialLeftLongFinish() {
453− AccountsService.demoEdgesCompleted = ["left", "top"];
455− var tutorialLeftLongTimer = findInvisibleChild(shell, "tutorialLeftLongTimer");
456− tutorialLeftLongTimer.interval = 1;
458− ApplicationManager.startApplication("gallery-app");
460 var tutorialLeftLongLoader = findChild(shell, "tutorialLeftLongLoader");
452 var tutorialLeftLongLoader = findChild(shell, "tutorialLeftLongLoader");
453+ openTutorialLeftLong();
461 tryCompare(tutorialLeftLongLoader, "shown", true);
455 tryCompare(tutorialLeftLongLoader, "shown", true);
463 touchFlick(shell, 0, halfHeight, shell.width, halfHeight);
457 touchFlick(shell, 0, halfHeight, shell.width, halfHeight);
465 tryCompare(tutorialLeftLongLoader, "shown", false);
459 tryCompare(tutorialLeftLongLoader, "shown", false);
466− tryCompare(AccountsService, "demoEdgesCompleted", ["left", "top", "left-long"]);
460+ tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left", "left-long"]);
469 function test_tutorialLeftAutoSkipped() {
463 function test_tutorialLeftAutoSkipped() {
470 // Test that we skip the tutorial if user uses left edge themselves
464 // Test that we skip the tutorial if user uses left edge themselves
465+ var launcher = findChild(shell, "launcher");
467+ AccountsService.demoEdgesCompleted = ["top"]
472 var tutorialLeft = findChild(shell, "tutorialLeft");
468 var tutorialLeft = findChild(shell, "tutorialLeft");
473− LightDM.Greeter.showGreeter();
469+ launcher.show();
474 tryCompare(tutorialLeft, "visible", false);
470 tryCompare(tutorialLeft, "visible", false);
475− compare(AccountsService.demoEdgesCompleted, []);
471+ compare(AccountsService.demoEdgesCompleted, ["top"]);
477 touchFlick(shell, 0, halfHeight, halfWidth, halfHeight);
473 touchFlick(shell, 0, halfHeight, halfWidth, halfHeight);
478− tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
474+ tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left"]);
481 function test_tutorialLongLeftSwipeDisabled() {
477 function test_tutorialLongLeftSwipeDisabled() {
482 // Test that a long left swipe is disabled until we get to or pass
478 // Test that a long left swipe is disabled until we get to or pass
483 // the long left tutorial.
479 // the long left tutorial.
484 var tutorial = findChild(shell, "tutorial");
480 var tutorial = findChild(shell, "tutorial");
481+ var launcher = findChild(shell, "launcher");
482+ var drawer = findChild(launcher, "drawer");
486− verify(!tutorial.launcherLongSwipeEnabled);
484+ // Waiting for top tutorial, the Launcher should be unavailable
486+ tryCompare(launcher, "state", "");
488− openTutorialLeftLong();
488+ // Swipe the left edge far enough to open the Drawer. Only the
489− verify(tutorial.launcherLongSwipeEnabled);
489+ // Launcher should appear.
492+ tryCompare(launcher, "state", "visible");
491− openTutorialRight();
494+ // Once the Drawer tutorial is open, the Drawer should appear on
492− verify(tutorial.launcherLongSwipeEnabled);
495+ // a long swipe.
496+ openTutorialLeftLong();
498+ tryCompare(launcher, "state", "drawer");
501+ // That should continue after the Tutorial is no more
494 AccountsService.demoEdges = false;
502 AccountsService.demoEdges = false;
495 tryCompare(tutorial, "running", false);
503 tryCompare(tutorial, "running", false);
496− verify(tutorial.launcherLongSwipeEnabled);
504+ longLeftSwipe();
505+ tryCompare(launcher, "state", "drawer");
499 function test_tutorialTopEdges() {
508 function test_tutorialTopEdges() {
@@ -503,8 +512,6 @@ Rectangle {
503 var stage = findChild(shell, "stage");
512 var stage = findChild(shell, "stage");
504 var panel = findChild(shell, "panel");
513 var panel = findChild(shell, "panel");
508 tryCompare(tutorial, "running", true);
515 tryCompare(tutorial, "running", true);
509 verify(!tutorial.launcherEnabled);
516 verify(!tutorial.launcherEnabled);
510 verify(!tutorial.spreadEnabled);
517 verify(!tutorial.spreadEnabled);
@@ -520,11 +527,10 @@ Rectangle {
520 var tutorialTopLoader = findChild(tutorial, "tutorialTopLoader");
527 var tutorialTopLoader = findChild(tutorial, "tutorialTopLoader");
521 var panel = findChild(shell, "panel");
528 var panel = findChild(shell, "panel");
524 touchFlick(shell, halfWidth, 0, halfWidth, shell.height);
530 touchFlick(shell, halfWidth, 0, halfWidth, shell.height);
526 tryCompare(tutorialTopLoader, "shown", false);
532 tryCompare(tutorialTopLoader, "shown", false);
527− tryCompare(AccountsService, "demoEdgesCompleted", ["left", "top"]);
533+ tryCompare(AccountsService, "demoEdgesCompleted", ["top"]);
528 tryCompare(panel.indicators, "fullyOpened", true);
534 tryCompare(panel.indicators, "fullyOpened", true);
@@ -533,7 +539,6 @@ Rectangle {
533 var tutorialTop = findChild(tutorial, "tutorialTop");
539 var tutorialTop = findChild(tutorial, "tutorialTop");
534 var panel = findChild(shell, "panel");
540 var panel = findChild(shell, "panel");
537 touchFlick(shell, halfWidth, 0, halfWidth, shell.height * 0.4, true, false);
542 touchFlick(shell, halfWidth, 0, halfWidth, shell.height * 0.4, true, false);
538 // compare opacity with a bound rather than hard 0.6 because progress doesn't
543 // compare opacity with a bound rather than hard 0.6 because progress doesn't
539 // always match the drag perfectly (takes a moment for drag to kick in)
544 // always match the drag perfectly (takes a moment for drag to kick in)
@@ -545,19 +550,6 @@ Rectangle {
545 compare(tutorialTop.shown, true);
550 compare(tutorialTop.shown, true);
548− function test_tutorialTopAutoSkipped() {
549− // Test that we skip the tutorial if user uses top edge themselves
551− var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
552− var tutorialTopLoader = findChild(shell, "tutorialTopLoader");
553− AccountsService.demoEdgesCompleted = ["left"];
554− tryCompare(tutorialLeftLoader, "active", false);
555− verify(!tutorialTopLoader.shown);
557− touchFlick(shell, halfWidth, 0, halfWidth, shell.height);
558− tryCompare(AccountsService, "demoEdgesCompleted", ["left", "top"]);
561 function test_tutorialRightEdges() {
553 function test_tutorialRightEdges() {
562 var tutorial = findChild(shell, "tutorial");
554 var tutorial = findChild(shell, "tutorial");
563 var tutorialRight = findChild(tutorial, "tutorialRight");
555 var tutorialRight = findChild(tutorial, "tutorialRight");
@@ -581,7 +573,7 @@ Rectangle {
581 openTutorialRight();
573 openTutorialRight();
582 touchFlick(shell, shell.width, halfHeight, 0, halfHeight);
574 touchFlick(shell, shell.width, halfHeight, 0, halfHeight);
584− tryCompare(AccountsService, "demoEdgesCompleted", ["left", "top", "left-long", "right"]);
576+ tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left", "left-long", "right"]);
585 tryCompare(AccountsService, "demoEdges", false);
577 tryCompare(AccountsService, "demoEdges", false);
@@ -608,13 +600,10 @@ Rectangle {
608 var tutorialRightLoader = findChild(shell, "tutorialRightLoader");
600 var tutorialRightLoader = findChild(shell, "tutorialRightLoader");
609 var tutorialRightTimer = findInvisibleChild(tutorialRightLoader, "tutorialRightTimer");
601 var tutorialRightTimer = findInvisibleChild(tutorialRightLoader, "tutorialRightTimer");
612 ApplicationManager.startApplication("gallery-app");
603 ApplicationManager.startApplication("gallery-app");
613− ApplicationManager.startApplication("facebook-webapp");
614− ApplicationManager.startApplication("camera-app");
615− tryCompare(ApplicationManager, "count", 4);
604+ tryCompare(ApplicationManager, "count", 1);
617− AccountsService.demoEdgesCompleted = ["left", "top", "left-long"];
606+ AccountsService.demoEdgesCompleted = ["top", "left", "left-long"];
618 verify(tutorialRightTimer.running);
607 verify(tutorialRightTimer.running);
619 verify(!tutorialRightLoader.shown);
608 verify(!tutorialRightLoader.shown);
620 tutorialRightTimer.interval = 1;
609 tutorialRightTimer.interval = 1;
@@ -624,18 +613,30 @@ Rectangle {
624 function test_tutorialRightAutoSkipped() {
613 function test_tutorialRightAutoSkipped() {
625 // Test that we skip the tutorial if user uses right edge themselves
614 // Test that we skip the tutorial if user uses right edge themselves
627− var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
616+ var tutorialLeftLongLoader = findChild(shell, "tutorialLeftLongLoader");
617+ var tutorialRight = findChild(shell, "tutorialRight");
618+ var tutorialRightTimer = findChild(tutorialRight, "tutorialRightTimer");
620+ tutorialRightTimer.interval = 9999999;
622+ ApplicationManager.startApplication("facebook-webapp");
623+ tryCompare(ApplicationManager, "count", 1);
628− AccountsService.demoEdgesCompleted = ["left"];
625+ AccountsService.demoEdgesCompleted = ["top", "left", "left-long"];
629− tryCompare(tutorialLeftLoader, "active", false);
626+ tryCompare(tutorialLeftLongLoader, "skipped", true);
627+ verify(tutorialRightTimer.running);
628+ tryCompare(tutorialRight, "isReady", true);
630+ // If the app isn't fully started, it may interrupt our attempt to swipe
631 touchFlick(shell, shell.width, halfHeight, 0, halfHeight);
633 touchFlick(shell, shell.width, halfHeight, 0, halfHeight);
632− tryCompare(AccountsService, "demoEdgesCompleted", ["left", "right"]);
634+ tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left", "left-long", "right"]);
635 function test_activeCallInterruptsTutorial() {
637 function test_activeCallInterruptsTutorial() {
636 var tutorialLeft = findChild(shell, "tutorialLeft");
638 var tutorialLeft = findChild(shell, "tutorialLeft");
637− verify(tutorialLeft.shown);
639+ openTutorialLeft();
638− verify(!tutorialLeft.paused);
640 callManager.foregroundCall = phoneCall;
641 callManager.foregroundCall = phoneCall;
641 verify(!tutorialLeft.shown);
642 verify(!tutorialLeft.shown);
@@ -648,18 +649,18 @@ Rectangle {
650 function test_greeterInterruptsTutorial() {
651 function test_greeterInterruptsTutorial() {
651− var tutorialLeft = findChild(shell, "tutorialLeft");
652+ var tutorialTop = findChild(shell, "tutorialTop");
652− verify(tutorialLeft.shown);
653+ verify(tutorialTop.shown);
653− verify(!tutorialLeft.paused);
654+ verify(!tutorialTop.paused);
655 LightDM.Greeter.showGreeter();
656 LightDM.Greeter.showGreeter();
656− verify(!tutorialLeft.shown);
657+ verify(!tutorialTop.shown);
657− verify(tutorialLeft.paused);
658+ verify(tutorialTop.paused);
658− tryCompare(tutorialLeft, "visible", false);
659+ tryCompare(tutorialTop, "visible", false);
660 LightDM.Greeter.hideGreeter();
661 LightDM.Greeter.hideGreeter();
661− tryCompare(tutorialLeft, "shown", true);
662+ tryCompare(tutorialTop, "shown", true);
662− verify(!tutorialLeft.paused);
663+ verify(!tutorialTop.paused);
665 function test_interruptionChecksReadyStateWhenDone() {
666 function test_interruptionChecksReadyStateWhenDone() {
@@ -682,7 +683,7 @@ Rectangle {
682 verify(!tutorialRight.isReady);
683 verify(!tutorialRight.isReady);
683 verify(!tutorialRight.shown);
684 verify(!tutorialRight.shown);
684 verify(!tutorialRight.paused);
685 verify(!tutorialRight.paused);
685− compare(AccountsService.demoEdgesCompleted, ["left", "top", "left-long"]);
686+ compare(AccountsService.demoEdgesCompleted, ["top", "left", "left-long"]);
688 function test_desktopOnlyShowsTutorialRight() {
689 function test_desktopOnlyShowsTutorialRight() {
@@ -701,8 +702,6 @@ Rectangle {
701 var tutorialRightTimer = findInvisibleChild(tutorialRightLoader, "tutorialRightTimer");
702 var tutorialRightTimer = findInvisibleChild(tutorialRightLoader, "tutorialRightTimer");
702 tutorialRightTimer.interval = 1;
703 tutorialRightTimer.interval = 1;
704− ApplicationManager.startApplication("dialer-app");
705− ApplicationManager.startApplication("camera-app");
706 ApplicationManager.startApplication("facebook-webapp");
705 ApplicationManager.startApplication("facebook-webapp");
707 tryCompare(tutorialRightLoader.item, "isReady", true);
706 tryCompare(tutorialRightLoader.item, "isReady", true);
@@ -715,8 +714,6 @@ Rectangle {
715 var tutorialRightLoader = findChild(shell, "tutorialRightLoader");
714 var tutorialRightLoader = findChild(shell, "tutorialRightLoader");
716 var tutorialRightTimer = findInvisibleChild(tutorialRightLoader, "tutorialRightTimer");
715 var tutorialRightTimer = findInvisibleChild(tutorialRightLoader, "tutorialRightTimer");
717 tutorialRightTimer.interval = 1;
716 tutorialRightTimer.interval = 1;
718− ApplicationManager.startApplication("dialer-app");
719− ApplicationManager.startApplication("camera-app");
720 ApplicationManager.startApplication("facebook-webapp");
717 ApplicationManager.startApplication("facebook-webapp");
721 tryCompare(tutorialRightLoader, "shown", true);
718 tryCompare(tutorialRightLoader, "shown", true);
@@ -729,8 +726,8 @@ Rectangle {
731 function test_oskDoesNotHideTutorial() {
728 function test_oskDoesNotHideTutorial() {
732− var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
729+ var tutorialTopLoader = findChild(shell, "tutorialTopLoader");
733− verify(tutorialLeftLoader.shown);
730+ verify(tutorialTopLoader.shown);
735 ensureInputMethodSurface();
732 ensureInputMethodSurface();
736 var surface = topLevelSurfaceList.inputMethodSurface;
733 var surface = topLevelSurfaceList.inputMethodSurface;
@@ -739,7 +736,7 @@ Rectangle {
739 var inputMethod = findInvisibleChild(shell, "inputMethod");
736 var inputMethod = findInvisibleChild(shell, "inputMethod");
740 tryCompare(inputMethod, "visible", true);
737 tryCompare(inputMethod, "visible", true);
742− verify(tutorialLeftLoader.shown);
739+ verify(tutorialTopLoader.shown);
745 function test_oskDelaysTutorial() {
742 function test_oskDelaysTutorial() {
@@ -775,41 +772,58 @@ Rectangle {
777 function test_delayedTutorial() {
774 function test_delayedTutorial() {
775+ var launcher = findChild(shell, "launcher");
778 var tutorial = findChild(shell, "tutorial");
776 var tutorial = findChild(shell, "tutorial");
779− var tutorialTop = findChild(tutorial, "tutorialTop");
777+ var tutorialLeft = findChild(tutorial, "tutorialLeft");
780− var tutorialTopTimer = findChild(tutorialTop, "tutorialTopTimer");
778+ var tutorialLeftTimer = findChild(tutorial, "tutorialLeftTimer");
779+ // Since we'll be using the Launcher and Drawer, the left tutorial
780+ // will be skipped entirely and we'll show the left long one.
781+ var tutorialLeftLong = findChild(tutorial, "tutorialLeftLong");
782+ var tutorialLeftLongTimer = findChild(tutorialLeftLong, "tutorialLeftLongTimer");
784+ // Don't need these to start before we're ready
785+ tutorialLeftTimer.interval = 999999;
786+ tutorialLeftLongTimer.interval = 1;
782− // Get top tutorial ready
788+ // Get left tutorial ready to be skipped
783− AccountsService.demoEdgesCompleted = ["left"];
789+ AccountsService.demoEdgesCompleted = ["top"];
784− verify(tutorialTop.isReady);
790+ tryCompare(tutorialLeft, "isReady", true);
785− verify(tutorialTopTimer.running);
791+ tryCompare(tutorialLeftTimer, "running", true);
787 // Confirm that we become unready when delayed, but timer still goes
793 // Confirm that we become unready when delayed, but timer still goes
788 tutorial.delayed = true;
794 tutorial.delayed = true;
789− verify(!tutorialTop.isReady);
795+ tryCompare(tutorialLeft, "isReady", false);
790− verify(tutorialTopTimer.running);
796+ tryCompare(tutorialLeftTimer, "running", true);
792 // Confirm that we don't open the tutorial when delayed
798 // Confirm that we don't open the tutorial when delayed
793− tutorialTopTimer.interval = 1;
799+ tutorialLeftTimer.interval = 1;
794− wait(5);
800+ wait(500);
795− verify(!tutorialTop.shown);
801+ verify(!tutorialLeft.shown);
803+ // Confirm the Launcher and Drawer can be opened when delayed
804+ tryCompare(tutorial, "launcherEnabled", true);
805+ tryCompare(tutorial, "launcherLongSwipeEnabled", true);
807+ tryCompare(launcher, "state", "drawer");
797 // Confirm we go back to normal when undelayed
810 // Confirm we go back to normal when undelayed
798 tutorial.delayed = false;
811 tutorial.delayed = false;
799− tryCompare(tutorialTop, "shown", true);
812+ tryCompare(tutorialLeftLong, "shown", true);
802 function test_accountsServiceSettings() {
815 function test_accountsServiceSettings() {
803− var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
816+ var tutorial = findChild(shell, "tutorial");
804− verify(tutorialLeftLoader.shown);
817+ var tutorialTopLoader = findChild(tutorial, "tutorialTopLoader");
818+ verify(tutorialTopLoader.shown);
806 AccountsService.demoEdges = false;
820 AccountsService.demoEdges = false;
807− verify(findChild(shell, "tutorialLeftLoader") == null);
821+ verify(findChild(tutorial, "tutorialTopLoader", 1) == null);
809 AccountsService.demoEdges = true;
823 AccountsService.demoEdges = true;
810− tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
824+ tutorialTopLoader = findChild(shell, "tutorialTopLoader");
811− var tutorialLeftTimer = findChild(tutorialLeftLoader, "tutorialLeftTimer");
825+ var tutorialTopTimer = findChild(tutorialTopLoader, "tutorialTopTimer");
812− verify(tutorialLeftTimer.running);
826+ verify(tutorialTopTimer.running);