@@ -24,6 +24,7 @@ import Unity.Application 0.1
2424import Unity.Test 0.1 as UT
2525
2626import "../../../qml"
27+import "../../../qml/Components"
2728
2829Item {
2930 id: root
@@ -73,6 +74,10 @@ Item {
7374 sourceComponent: Component {
7475 Shell {
7576 property string indicatorProfile: "phone"
77+ orientations: Orientations {
78+ native_: Qt.PortraitOrientation
79+ primary: Qt.PortraitOrientation
80+ }
7681
7782 Component.onDestruction: {
7883 shellLoader.itemDestroyed = true;
@@ -221,6 +226,7 @@ Item {
221226
222227 // kill all (fake) running apps
223228 killApps();
229+ SurfaceManager.inputMethodSurface().destroy(); // so that InputMethod will notice new one
224230
225231 // reload our test subject to get it in a fresh state once again
226232 shellLoader.active = true;
@@ -288,20 +294,6 @@ Item {
288294 tryCompare(tutorialBottom, "opacity", 1);
289295 }
290296
291− function test_longPressDismissesTutorialPage() {
292− var tutorialLeft = findChild(shell, "tutorialLeft");
293−
294− verify(tutorialLeft.shown);
295− compare(AccountsService.demoEdgesCompleted, []);
296−
297− mousePress(tutorialLeft);
298− wait(1000);
299− mouseRelease(tutorialLeft);
300−
301− tryCompare(tutorialLeft, "shown", false);
302− tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
303− }
304−
305297 function test_tutorialLeftEdges() {
306298 var tutorial = findChild(shell, "tutorial");
307299 var tutorialLeft = findChild(tutorial, "tutorialLeft");
@@ -377,6 +369,18 @@ Item {
377369 tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
378370 }
379371
372+ function test_tutorialLeftAutoSkipped() {
373+ // Test that we skip the tutorial if user uses left edge themselves
374+
375+ var tutorialLeft = findChild(shell, "tutorialLeft");
376+ LightDM.Greeter.showGreeter();
377+ tryCompare(tutorialLeft, "visible", false);
378+ compare(AccountsService.demoEdgesCompleted, []);
379+
380+ touchFlick(shell, 0, halfHeight, halfWidth, halfHeight);
381+ tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
382+ }
383+
380384 function test_tutorialTopEdges() {
381385 var tutorial = findChild(shell, "tutorial");
382386 var tutorialTop = findChild(tutorial, "tutorialTop");
@@ -491,17 +495,16 @@ Item {
491495 // Test that if we exit the top tutorial, we don't immediately
492496 // jump into right tutorial.
493497 var tutorialRight = findChild(shell, "tutorialRight");
494− var tutorialRightTimer = findInvisibleChild(tutorialRight, "tutorialRightTimer");
498+ var tutorialRightTimer = findInvisibleChild(tutorialRight, "tutorialRightInactivityTimer");
495499
496500 tutorialRightTimer.interval = 1;
497501 openTutorialTop();
498− ApplicationManager.startApplication("dialer-app");
499− ApplicationManager.startApplication("camera-app");
500− ApplicationManager.startApplication("messaging-app");
502+ ApplicationManager.startApplication("gallery-app");
503+ ApplicationManager.startApplication("facebook-webapp");
501504 tryCompare(ApplicationManager, "count", 3);
502505
503506 AccountsService.demoEdgesCompleted = ["left", "top"];
504− verify(tutorialRightTimer.running);
507+ verify(tutorialRightTimer.running, true);
505508 verify(!tutorialRight.shown);
506509 tryCompare(tutorialRight, "shown", true);
507510 }
@@ -576,7 +579,7 @@ Item {
576579 tryCompare(tutorialLeft, "visible", false);
577580
578581 callManager.foregroundCall = null;
579− verify(tutorialLeft.shown);
582+ tryCompare(tutorialLeft, "shown", true);
580583 verify(!tutorialLeft.paused);
581584 }
582585
@@ -659,13 +662,16 @@ Item {
659662 surface.setState(Mir.RestoredState);
660663 tryCompare(inputMethod, "state", "shown");
661664
665+ var tutorial = findChild(shell, "tutorial");
666+ tryCompare(tutorial, "keyboardVisible", true);
667+
662668 AccountsService.demoEdges = true;
663669 var tutorialLeft = findChild(shell, "tutorialLeft");
664670 verify(!tutorialLeft.shown);
665671
666672 surface.setState(Mir.MinimizedState);
667673 tryCompare(inputMethod, "state", "hidden");
668− verify(tutorialLeft.shown);
674+ tryCompare(tutorialLeft, "shown", false);
669675 }
670676
671677 function test_accountsServiceSettings() {
@@ -679,7 +685,7 @@ Item {
679685 AccountsService.demoEdges = true;
680686 tutorialLeft = findChild(shell, "tutorialLeft");
681687 verify(tutorialLeft != null);
682− verify(tutorialLeft.shown);
688+ tryCompare(tutorialLeft, "shown", true);
683689 }
684690 }
685691}