@@ -500,39 +500,37 @@ Rectangle {
500 function test_appSupportingOnlyPrimaryOrientationMakesPhoneShellStayPut() {
500 function test_appSupportingOnlyPrimaryOrientationMakesPhoneShellStayPut() {
501 loadShell("mako");
501 loadShell("mako");
503− var spreadRepeater = findChild(shell, "spreadRepeater");
503+ var primarySurfaceId = topLevelSurfaceList.nextId;
504− verify(spreadRepeater);
504+ var primaryApp = ApplicationManager.startApplication("primary-oriented-app");
505−
505+ verify(primaryApp);
506− // unity8-dash supports only primary orientation and should be already running
506+ waitUntilAppWindowIsFullyLoaded(primarySurfaceId);
507− compare(spreadRepeater.count, 1);
507+
508− var dashDelegate = spreadRepeater.itemAt(0);
508+ var primaryAppWindow = findAppWindowForSurfaceId(primarySurfaceId);
509− var dashApp = dashDelegate.application;
509+ verify(primaryAppWindow)
510− verify(dashApp);
510+ var primaryDelegate = findChild(shell, "spreadDelegate_" + primarySurfaceId);
511− compare(dashApp.appId, "unity8-dash");
511+
512− var dashAppWindow = findChild(dashDelegate, "appWindow");
513− verify(dashAppWindow);
514− compare(dashDelegate.focus, true);
512+ compare(primaryDelegate.focus, true);
515− compare(dashApp.rotatesWindowContents, false);
513+ compare(primaryApp.rotatesWindowContents, false);
516− compare(dashApp.supportedOrientations, Qt.PrimaryOrientation);
514+ compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
517− compare(dashApp.stage, ApplicationInfoInterface.MainStage);
515+ compare(primaryApp.stage, ApplicationInfoInterface.MainStage);
519− tryCompareFunction(function(){return dashDelegate.surface != null;}, true);
517+ tryCompareFunction(function(){return primaryDelegate.surface != null;}, true);
520− verify(checkAppSurfaceOrientation(dashAppWindow, dashApp, root.primaryOrientationAngle));
518+ verify(checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle));
522 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
520 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
523 rotateTo(90);
521 rotateTo(90);
525− verify(checkAppSurfaceOrientation(dashAppWindow, dashApp, root.primaryOrientationAngle));
523+ verify(checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle));
526 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
524 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
528 rotateTo(180);
526 rotateTo(180);
530− verify(checkAppSurfaceOrientation(dashAppWindow, dashApp, root.primaryOrientationAngle));
528+ verify(checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle));
531 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
529 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
533 rotateTo(270);
531 rotateTo(270);
535− verify(checkAppSurfaceOrientation(dashAppWindow, dashApp, root.primaryOrientationAngle));
533+ verify(checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle));
536 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
534 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
@@ -545,37 +543,39 @@ Rectangle {
545 function test_appSupportingOnlyPrimaryOrientationWillOnlyRotateInLandscape(data) {
543 function test_appSupportingOnlyPrimaryOrientationWillOnlyRotateInLandscape(data) {
546 loadShell(data.deviceName);
544 loadShell(data.deviceName);
548− compare(topLevelSurfaceList.applicationAt(0).appId, "unity8-dash");
546+ var primarySurfaceId = topLevelSurfaceList.nextId;
549− var dashSurfaceId = topLevelSurfaceList.idAt(0);
547+ var primaryApp = ApplicationManager.startApplication("primary-oriented-app");
549+ waitUntilAppWindowIsFullyLoaded(primarySurfaceId);
550− var dashAppWindow = findAppWindowForSurfaceId(dashSurfaceId);
551+ var primaryAppWindow = findAppWindowForSurfaceId(primarySurfaceId);
552+ verify(primaryAppWindow)
552− // unity8-dash supports only primary orientation and should be already running
554+ // primary-oriented-app supports only primary orientation
554− compare(ApplicationManager.focusedApplicationId, "unity8-dash");
556+ compare(ApplicationManager.focusedApplicationId, "primary-oriented-app");
555− var dashApp = dashAppWindow.application;
557− compare(dashApp.rotatesWindowContents, false);
557+ compare(primaryApp.rotatesWindowContents, false);
558− compare(dashApp.supportedOrientations, Qt.PrimaryOrientation);
558+ compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
559− compare(dashApp.stage, ApplicationInfoInterface.MainStage);
559+ compare(primaryApp.stage, ApplicationInfoInterface.MainStage);
561− tryCompareFunction(function(){return dashApp.surfaceList.count > 0;}, true);
561+ tryCompareFunction(function(){return primaryApp.surfaceList.count > 0;}, true);
563− tryCompareFunction(function(){return checkAppSurfaceOrientation(dashAppWindow, dashApp, root.primaryOrientationAngle)}, true);
563+ tryCompareFunction(function(){return checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle)}, true);
564 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
564 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
566 rotateTo(90);
566 rotateTo(90);
568− tryCompareFunction(function(){return checkAppSurfaceOrientation(dashAppWindow, dashApp, root.primaryOrientationAngle)}, true);
568+ tryCompareFunction(function(){return checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle)}, true);
569 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
569 compare(shell.transformRotationAngle, root.primaryOrientationAngle);
571 rotateTo(180);
571 rotateTo(180);
573− tryCompareFunction(function(){return checkAppSurfaceOrientation(dashAppWindow, dashApp, root.primaryOrientationAngle + 180)}, true);
573+ tryCompareFunction(function(){return checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle + 180)}, true);
574 compare(shell.transformRotationAngle, root.primaryOrientationAngle + 180);
574 compare(shell.transformRotationAngle, root.primaryOrientationAngle + 180);
576 rotateTo(270);
576 rotateTo(270);
578− tryCompareFunction(function(){return checkAppSurfaceOrientation(dashAppWindow, dashApp, root.primaryOrientationAngle + 180)}, true);
578+ tryCompareFunction(function(){return checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle + 180)}, true);
579 compare(shell.transformRotationAngle, root.primaryOrientationAngle + 180);
579 compare(shell.transformRotationAngle, root.primaryOrientationAngle + 180);
@@ -803,12 +803,13 @@ Rectangle {
806+ - launch an app that only supports the primary orientation
806 - launch an app that supports all orientations, such as twitter-webapp
807 - launch an app that supports all orientations, such as twitter-webapp
807 - wait a bit until that app is considered to have finished initializing and is thus
808 - wait a bit until that app is considered to have finished initializing and is thus
808 ready to get resized/rotated
809 ready to get resized/rotated
809− - switch back to dash
810+ - switch back to previous app (only supporting primary
810 - rotate device to 90 degrees
811 - rotate device to 90 degrees
811− - Physical orientation is 90 but Shell orientation is kept at 0 because unity8-dash
812+ - Physical orientation is 90 but Shell orientation is kept at 0 because the app
812 doesn't support such orientation
813 doesn't support such orientation
813 - do a long right-edge drag to show the apps spread
814 - do a long right-edge drag to show the apps spread
814 - tap on twitter-webapp
815 - tap on twitter-webapp
@@ -825,6 +826,13 @@ Rectangle {
826 function test_greeterStaysAwayAfterRotation() {
827 function test_greeterStaysAwayAfterRotation() {
827 loadShell("mako");
828 loadShell("mako");
830+ // Load an app which only supports primary
831+ var primarySurfaceId = topLevelSurfaceList.nextId;
832+ var primaryApp = ApplicationManager.startApplication("primary-oriented-app");
834+ waitUntilAppWindowIsFullyLoaded(primarySurfaceId);
828 var twitterSurfaceId = topLevelSurfaceList.nextId;
836 var twitterSurfaceId = topLevelSurfaceList.nextId;
829 var twitterApp = ApplicationManager.startApplication("twitter-webapp");
837 var twitterApp = ApplicationManager.startApplication("twitter-webapp");
830 verify(twitterApp);
838 verify(twitterApp);
@@ -837,12 +845,11 @@ Rectangle {
837 waitUntilAppWindowIsFullyLoaded(twitterSurfaceId);
845 waitUntilAppWindowIsFullyLoaded(twitterSurfaceId);
838 waitUntilAppWindowCanRotate(twitterSurfaceId);
846 waitUntilAppWindowCanRotate(twitterSurfaceId);
840− // go back to unity8-dash
848+ // go back to primary-oriented-app
841 performEdgeSwipeToSwitchToPreviousApp();
849 performEdgeSwipeToSwitchToPreviousApp();
843 rotateTo(90);
851 rotateTo(90);
844 wait(1); // spin the event loop to let all bindings do their thing
852 wait(1); // spin the event loop to let all bindings do their thing
845− // should not rotat as unity8-dash doesn't support it
846 tryCompare(shell, "transformRotationAngle", 0);
853 tryCompare(shell, "transformRotationAngle", 0);
848 performEdgeSwipeToShowAppSpread();
855 performEdgeSwipeToShowAppSpread();