@@ -515,7 +515,6 @@ Rectangle {
515 compare(primaryDelegate.focus, true);
515 compare(primaryDelegate.focus, true);
516 compare(primaryApp.rotatesWindowContents, false);
516 compare(primaryApp.rotatesWindowContents, false);
517 compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
517 compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
518− compare(primaryApp.stage, ApplicationInfoInterface.MainStage);
520 tryCompareFunction(function(){return primaryDelegate.surface != null;}, true);
519 tryCompareFunction(function(){return primaryDelegate.surface != null;}, true);
521 verify(checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle));
520 verify(checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle));
@@ -559,7 +558,8 @@ Rectangle {
559 compare(ApplicationManager.focusedApplicationId, "primary-oriented-app");
558 compare(ApplicationManager.focusedApplicationId, "primary-oriented-app");
560 compare(primaryApp.rotatesWindowContents, false);
559 compare(primaryApp.rotatesWindowContents, false);
561 compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
560 compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
561+ var primaryDelegate = findChild(shell, "spreadDelegate_" + primarySurfaceId);
562− compare(primaryApp.stage, ApplicationInfoInterface.MainStage);
562+ compare(primaryDelegate.stage, ApplicationInfoInterface.MainStage);
564 tryCompareFunction(function(){return primaryApp.surfaceList.count > 0;}, true);
564 tryCompareFunction(function(){return primaryApp.surfaceList.count > 0;}, true);
@@ -599,7 +599,6 @@ Rectangle {
599 compare(gmailApp.rotatesWindowContents, false);
599 compare(gmailApp.rotatesWindowContents, false);
600 compare(gmailApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
600 compare(gmailApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
601 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
601 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
602− compare(gmailApp.stage, ApplicationInfoInterface.MainStage);
604 // wait until it's able to rotate
603 // wait until it's able to rotate
605 tryCompare(shell, "orientationChangesEnabled", true);
604 tryCompare(shell, "orientationChangesEnabled", true);
@@ -724,7 +723,6 @@ Rectangle {
724 compare(gmailApp.rotatesWindowContents, false);
723 compare(gmailApp.rotatesWindowContents, false);
725 compare(gmailApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
724 compare(gmailApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
726 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
725 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
727− compare(gmailApp.stage, ApplicationInfoInterface.MainStage);
729 waitUntilAppWindowIsFullyLoaded(gmailSurfaceId);
727 waitUntilAppWindowIsFullyLoaded(gmailSurfaceId);
@@ -736,7 +734,10 @@ Rectangle {
736 compare(musicApp.rotatesWindowContents, false);
734 compare(musicApp.rotatesWindowContents, false);
737 compare(musicApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
735 compare(musicApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
738 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
736 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
737+ if (data.deviceName === "manta" || data.deviceName === "flo") {
738+ var musicDelegate = findChild(shell, "spreadDelegate_" + musicSurfaceId);
739− compare(musicApp.stage, ApplicationInfoInterface.MainStage);
739+ compare(musicDelegate.stage, ApplicationInfoInterface.MainStage);
741 waitUntilAppWindowIsFullyLoaded(musicSurfaceId);
742 waitUntilAppWindowIsFullyLoaded(musicSurfaceId);
742 tryCompare(shell, "orientationChangesEnabled", true);
743 tryCompare(shell, "orientationChangesEnabled", true);
@@ -889,6 +890,7 @@ Rectangle {
891 function test_appInSideStageDoesntRotateOnStartUp(data) {
892 function test_appInSideStageDoesntRotateOnStartUp(data) {
893+ WindowStateStorage.saveStage("twitter-webapp", ApplicationInfoInterface.SideStage)
892 loadShell(data.deviceName);
894 loadShell(data.deviceName);
894 var twitterDelegate = null;
896 var twitterDelegate = null;
@@ -905,9 +907,11 @@ Rectangle {
905 signalSpy.target = null;
907 signalSpy.target = null;
906 signalSpy.signalName = "runningChanged";
908 signalSpy.signalName = "runningChanged";
910+ var twitterSurfaceId = topLevelSurfaceList.nextId;
908 var twitterApp = ApplicationManager.startApplication("twitter-webapp");
911 var twitterApp = ApplicationManager.startApplication("twitter-webapp");
909 verify(twitterApp);
912 verify(twitterApp);
913+ var twitterDelegate = findChild(shell, "spreadDelegate_" + twitterSurfaceId);
910− twitterApp.stage = ApplicationInfoInterface.SideStage;
914+ compare(twitterDelegate.stage, ApplicationInfoInterface.SideStage);
912 // ensure the mock twitter-webapp is as we expect
916 // ensure the mock twitter-webapp is as we expect
913 compare(twitterApp.rotatesWindowContents, false);
917 compare(twitterApp.rotatesWindowContents, false);