@@ -24,6 +24,7 @@ import Unity.Application 0.1
24import Unity.Test 0.1 as UT
24import Unity.Test 0.1 as UT
26import "../../../qml"
26import "../../../qml"
27+import "../../../qml/Components"
@@ -73,6 +74,10 @@ Item {
73 sourceComponent: Component {
74 sourceComponent: Component {
75 property string indicatorProfile: "phone"
76 property string indicatorProfile: "phone"
77+ orientations: Orientations {
78+ native_: Qt.PortraitOrientation
79+ primary: Qt.PortraitOrientation
77 Component.onDestruction: {
82 Component.onDestruction: {
78 shellLoader.itemDestroyed = true;
83 shellLoader.itemDestroyed = true;
@@ -221,6 +226,7 @@ Item {
222 // kill all (fake) running apps
227 // kill all (fake) running apps
223 killApps();
228 killApps();
229+ SurfaceManager.inputMethodSurface().destroy(); // so that InputMethod will notice new one
225 // reload our test subject to get it in a fresh state once again
231 // reload our test subject to get it in a fresh state once again
226 shellLoader.active = true;
232 shellLoader.active = true;
@@ -288,20 +294,6 @@ Item {
288 tryCompare(tutorialBottom, "opacity", 1);
294 tryCompare(tutorialBottom, "opacity", 1);
291− function test_longPressDismissesTutorialPage() {
292− var tutorialLeft = findChild(shell, "tutorialLeft");
294− verify(tutorialLeft.shown);
295− compare(AccountsService.demoEdgesCompleted, []);
297− mousePress(tutorialLeft);
299− mouseRelease(tutorialLeft);
301− tryCompare(tutorialLeft, "shown", false);
302− tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
305 function test_tutorialLeftEdges() {
297 function test_tutorialLeftEdges() {
306 var tutorial = findChild(shell, "tutorial");
298 var tutorial = findChild(shell, "tutorial");
307 var tutorialLeft = findChild(tutorial, "tutorialLeft");
299 var tutorialLeft = findChild(tutorial, "tutorialLeft");
@@ -377,6 +369,18 @@ Item {
377 tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
369 tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
372+ function test_tutorialLeftAutoSkipped() {
373+ // Test that we skip the tutorial if user uses left edge themselves
375+ var tutorialLeft = findChild(shell, "tutorialLeft");
376+ LightDM.Greeter.showGreeter();
377+ tryCompare(tutorialLeft, "visible", false);
378+ compare(AccountsService.demoEdgesCompleted, []);
380+ touchFlick(shell, 0, halfHeight, halfWidth, halfHeight);
381+ tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
380 function test_tutorialTopEdges() {
384 function test_tutorialTopEdges() {
381 var tutorial = findChild(shell, "tutorial");
385 var tutorial = findChild(shell, "tutorial");
382 var tutorialTop = findChild(tutorial, "tutorialTop");
386 var tutorialTop = findChild(tutorial, "tutorialTop");
@@ -491,17 +495,16 @@ Item {
491 // Test that if we exit the top tutorial, we don't immediately
495 // Test that if we exit the top tutorial, we don't immediately
492 // jump into right tutorial.
496 // jump into right tutorial.
493 var tutorialRight = findChild(shell, "tutorialRight");
497 var tutorialRight = findChild(shell, "tutorialRight");
494− var tutorialRightTimer = findInvisibleChild(tutorialRight, "tutorialRightTimer");
498+ var tutorialRightTimer = findInvisibleChild(tutorialRight, "tutorialRightInactivityTimer");
496 tutorialRightTimer.interval = 1;
500 tutorialRightTimer.interval = 1;
497 openTutorialTop();
501 openTutorialTop();
498− ApplicationManager.startApplication("dialer-app");
502+ ApplicationManager.startApplication("gallery-app");
499− ApplicationManager.startApplication("camera-app");
500− ApplicationManager.startApplication("messaging-app");
503+ ApplicationManager.startApplication("facebook-webapp");
501 tryCompare(ApplicationManager, "count", 3);
504 tryCompare(ApplicationManager, "count", 3);
503 AccountsService.demoEdgesCompleted = ["left", "top"];
506 AccountsService.demoEdgesCompleted = ["left", "top"];
504− verify(tutorialRightTimer.running);
507+ verify(tutorialRightTimer.running, true);
505 verify(!tutorialRight.shown);
508 verify(!tutorialRight.shown);
506 tryCompare(tutorialRight, "shown", true);
509 tryCompare(tutorialRight, "shown", true);
@@ -576,7 +579,7 @@ Item {
576 tryCompare(tutorialLeft, "visible", false);
579 tryCompare(tutorialLeft, "visible", false);
578 callManager.foregroundCall = null;
581 callManager.foregroundCall = null;
579− verify(tutorialLeft.shown);
582+ tryCompare(tutorialLeft, "shown", true);
580 verify(!tutorialLeft.paused);
583 verify(!tutorialLeft.paused);
@@ -659,13 +662,16 @@ Item {
659 surface.setState(Mir.RestoredState);
662 surface.setState(Mir.RestoredState);
660 tryCompare(inputMethod, "state", "shown");
663 tryCompare(inputMethod, "state", "shown");
665+ var tutorial = findChild(shell, "tutorial");
666+ tryCompare(tutorial, "keyboardVisible", true);
662 AccountsService.demoEdges = true;
668 AccountsService.demoEdges = true;
663 var tutorialLeft = findChild(shell, "tutorialLeft");
669 var tutorialLeft = findChild(shell, "tutorialLeft");
664 verify(!tutorialLeft.shown);
670 verify(!tutorialLeft.shown);
666 surface.setState(Mir.MinimizedState);
672 surface.setState(Mir.MinimizedState);
667 tryCompare(inputMethod, "state", "hidden");
673 tryCompare(inputMethod, "state", "hidden");
668− verify(tutorialLeft.shown);
674+ tryCompare(tutorialLeft, "shown", false);
671 function test_accountsServiceSettings() {
677 function test_accountsServiceSettings() {
@@ -679,7 +685,7 @@ Item {
679 AccountsService.demoEdges = true;
685 AccountsService.demoEdges = true;
680 tutorialLeft = findChild(shell, "tutorialLeft");
686 tutorialLeft = findChild(shell, "tutorialLeft");
681 verify(tutorialLeft != null);
687 verify(tutorialLeft != null);
682− verify(tutorialLeft.shown);
688+ tryCompare(tutorialLeft, "shown", true);