on xenial help sign in
Update tests
commitccb18885bf25ab4e51595dcb326815652c661ec0 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateMon 1 Aug 2016, 21:16 (10 years ago) parentaa017a9
2 files changed+24−10
tests/qmltests/tst_OrientedShell.qml+10−6 tests/qmltests/tst_Shell.qml+14−4
tests/qmltests/tst_OrientedShell.qml+10−6
@@ -515,7 +515,6 @@ Rectangle {
515515 compare(primaryDelegate.focus, true);
516516 compare(primaryApp.rotatesWindowContents, false);
517517 compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
518− compare(primaryApp.stage, ApplicationInfoInterface.MainStage);
519518
520519 tryCompareFunction(function(){return primaryDelegate.surface != null;}, true);
521520 verify(checkAppSurfaceOrientation(primaryAppWindow, primaryApp, root.primaryOrientationAngle));
@@ -559,7 +558,8 @@ Rectangle {
559558 compare(ApplicationManager.focusedApplicationId, "primary-oriented-app");
560559 compare(primaryApp.rotatesWindowContents, false);
561560 compare(primaryApp.supportedOrientations, Qt.PrimaryOrientation);
562− compare(primaryApp.stage, ApplicationInfoInterface.MainStage);
561+ var primaryDelegate = findChild(shell, "spreadDelegate_" + primarySurfaceId);
562+ compare(primaryDelegate.stage, ApplicationInfoInterface.MainStage);
563563
564564 tryCompareFunction(function(){return primaryApp.surfaceList.count > 0;}, true);
565565
@@ -599,7 +599,6 @@ Rectangle {
599599 compare(gmailApp.rotatesWindowContents, false);
600600 compare(gmailApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
601601 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
602− compare(gmailApp.stage, ApplicationInfoInterface.MainStage);
603602
604603 // wait until it's able to rotate
605604 tryCompare(shell, "orientationChangesEnabled", true);
@@ -724,7 +723,6 @@ Rectangle {
724723 compare(gmailApp.rotatesWindowContents, false);
725724 compare(gmailApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
726725 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
727− compare(gmailApp.stage, ApplicationInfoInterface.MainStage);
728726
729727 waitUntilAppWindowIsFullyLoaded(gmailSurfaceId);
730728
@@ -736,7 +734,10 @@ Rectangle {
736734 compare(musicApp.rotatesWindowContents, false);
737735 compare(musicApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
738736 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
739− compare(musicApp.stage, ApplicationInfoInterface.MainStage);
737+ if (data.deviceName === "manta" || data.deviceName === "flo") {
738+ var musicDelegate = findChild(shell, "spreadDelegate_" + musicSurfaceId);
739+ compare(musicDelegate.stage, ApplicationInfoInterface.MainStage);
740+ }
740741
741742 waitUntilAppWindowIsFullyLoaded(musicSurfaceId);
742743 tryCompare(shell, "orientationChangesEnabled", true);
@@ -889,6 +890,7 @@ Rectangle {
889890 ];
890891 }
891892 function test_appInSideStageDoesntRotateOnStartUp(data) {
893+ WindowStateStorage.saveStage("twitter-webapp", ApplicationInfoInterface.SideStage)
892894 loadShell(data.deviceName);
893895
894896 var twitterDelegate = null;
@@ -905,9 +907,11 @@ Rectangle {
905907 signalSpy.target = null;
906908 signalSpy.signalName = "runningChanged";
907909
910+ var twitterSurfaceId = topLevelSurfaceList.nextId;
908911 var twitterApp = ApplicationManager.startApplication("twitter-webapp");
909912 verify(twitterApp);
910− twitterApp.stage = ApplicationInfoInterface.SideStage;
913+ var twitterDelegate = findChild(shell, "spreadDelegate_" + twitterSurfaceId);
914+ compare(twitterDelegate.stage, ApplicationInfoInterface.SideStage);
911915
912916 // ensure the mock twitter-webapp is as we expect
913917 compare(twitterApp.rotatesWindowContents, false);
tests/qmltests/tst_Shell.qml+14−4
@@ -2103,8 +2103,13 @@ Rectangle {
21032103 waitUntilAppWindowIsFullyLoaded(app2SurfaceId);
21042104
21052105 // Sanity checking
2106− compare(app1.stage, ApplicationInfoInterface.MainStage);
2107− compare(app2.stage, ApplicationInfoInterface.MainStage);
2106+ if (data.usageScenario === "tablet") {
2107+ var app1Delegate = findChild(shell, "spreadDelegate_" + app1SurfaceId);
2108+ compare(app1Delegate.stage, ApplicationInfoInterface.MainStage);
2109+
2110+ var app2Delegate = findChild(shell, "spreadDelegate_" + app2SurfaceId);
2111+ compare(app2Delegate.stage, ApplicationInfoInterface.MainStage);
2112+ }
21082113 verify(!app1.isTouchApp);
21092114
21102115 var app1Surface = app1.surfaceList.get(0);
@@ -2139,8 +2144,13 @@ Rectangle {
21392144 waitUntilAppWindowIsFullyLoaded(app2SurfaceId);
21402145
21412146 // Sanity checking
2142− compare(app1.stage, ApplicationInfoInterface.MainStage);
2143− compare(app2.stage, ApplicationInfoInterface.MainStage);
2147+ if (data.usageScenario === "tablet") {
2148+ var app1Delegate = findChild(shell, "spreadDelegate_" + app1SurfaceId);
2149+ compare(app1Delegate.stage, ApplicationInfoInterface.MainStage);
2150+
2151+ var app2Delegate = findChild(shell, "spreadDelegate_" + app2SurfaceId);
2152+ compare(app2Delegate.stage, ApplicationInfoInterface.MainStage);
2153+ }
21442154
21452155 var app1Surface = app1.surfaceList.get(0);
21462156 verify(app1Surface);