on xenial help sign in
Update more tst_Shell tests
commit6fb9fec52bdf813be7599773884f800a58d39c29 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateTue 5 Apr 2016, 11:35 (11 years ago) parent9dddd5f
1 file changed+18−21
tests/qmltests/tst_Shell.qml+18−21
tests/qmltests/tst_Shell.qml+18−21
@@ -529,10 +529,10 @@ Rectangle {
529529 loadShell("phone");
530530 swipeAwayGreeter();
531531 var notifications = findChild(shell, "notificationList");
532+ var appSurfaceId = topLevelSurfaceList.nextId;
532533 var app = ApplicationManager.startApplication("camera-app");
534+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
533535 var stage = findChild(shell, "stage")
534− // Open an application
535− waitUntilApplicationWindowIsFullyVisible(app);
536536
537537 var appSurface = app.surfaceList.get(0);
538538 verify(appSurface);
@@ -625,10 +625,9 @@ Rectangle {
625625 loadShell("phone");
626626 swipeAwayGreeter();
627627 dragLauncherIntoView();
628+ var appSurfaceId = topLevelSurfaceList.nextId;
628629 tapOnAppIconInLauncher();
629− waitUntilApplicationWindowIsFullyVisible();
630− ApplicationManager.focusApplication(data.focusedApp)
631− waitUntilApplicationWindowIsFullyVisible();
630+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
632631
633632 var greeter = findChild(shell, "greeter");
634633 if (data.greeterShown) {
@@ -644,7 +643,6 @@ Rectangle {
644643 waitUntilDashIsFocused();
645644 tryCompare(greeter, "shown", false);
646645 } else {
647− waitUntilApplicationWindowIsFullyVisible();
648646 compare(greeter.fullyShown, data.greeterShown);
649647 }
650648
@@ -683,10 +681,11 @@ Rectangle {
683681 dragLauncherIntoView();
684682 dashCommunicatorSpy.clear();
685683
684+ var appSurfaceId = topLevelSurfaceList.nextId;
686685 tapOnAppIconInLauncher();
687− waitUntilApplicationWindowIsFullyVisible();
686+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
688687
689− verify(ApplicationManager.focusedApplicationId !== "unity8-dash")
688+ tryCompareFunction(function() { return ApplicationManager.focusedApplicationId !== "unity8-dash"; }, true);
690689
691690 //Long left swipe
692691 swipeFromLeftEdge(units.gu(30));
@@ -719,8 +718,9 @@ Rectangle {
719718
720719 // Launch an app from the launcher
721720 dragLauncherIntoView();
721+ var appSurfaceId = topLevelSurfaceList.nextId;
722722 tapOnAppIconInLauncher();
723− waitUntilApplicationWindowIsFullyVisible();
723+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
724724
725725 var mainAppId = ApplicationManager.focusedApplicationId;
726726 verify(mainAppId != "");
@@ -845,9 +845,9 @@ Rectangle {
845845 dragLauncherIntoView();
846846
847847 // Launch an app from the launcher
848+ var appSurfaceId = topLevelSurfaceList.nextId;
848849 tapOnAppIconInLauncher();
849−
850− waitUntilApplicationWindowIsFullyVisible();
850+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
851851
852852 verify(ApplicationManager.focusedApplicationId !== "unity8-dash")
853853
@@ -1040,12 +1040,6 @@ Rectangle {
10401040 }
10411041 }
10421042
1043− function waitUntilApplicationWindowIsFullyVisible() {
1044− var appDelegate = findChild(shell, "spreadDelegate_" + topLevelSurfaceList.idAt(0));
1045− var surfaceContainer = findChild(appDelegate, "surfaceContainer");
1046− tryCompareFunction(function() { return surfaceContainer.surface !== null; }, true);
1047− }
1048−
10491043 function waitUntilDashIsFocused() {
10501044 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
10511045 }
@@ -1102,8 +1096,9 @@ Rectangle {
11021096 swipeAwayGreeter();
11031097 var greeter = findChild(shell, "greeter");
11041098
1099+ var appSurfaceId = topLevelSurfaceList.nextId;
11051100 var app = ApplicationManager.startApplication("dialer-app");
1106− waitUntilApplicationWindowIsFullyVisible(app);
1101+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
11071102
11081103 // Minimize the application we just launched
11091104 swipeFromLeftEdge(shell.width * 0.75);
@@ -1164,11 +1159,13 @@ Rectangle {
11641159 swipeAwayGreeter();
11651160 var panel = findChild(shell, "panel");
11661161 compare(panel.fullscreenMode, false);
1162+ var cameraSurfaceId = topLevelSurfaceList.nextId;
11671163 var cameraApp = ApplicationManager.startApplication("camera-app");
1168− waitUntilApplicationWindowIsFullyVisible(cameraApp);
1164+ waitUntilAppWindowIsFullyLoaded(cameraSurfaceId);
11691165 tryCompare(panel, "fullscreenMode", true);
1166+ var dialerSurfaceId = topLevelSurfaceList.nextId;
11701167 var dialerApp = ApplicationManager.startApplication("dialer-app");
1171− waitUntilApplicationWindowIsFullyVisible(dialerApp);
1168+ waitUntilAppWindowIsFullyLoaded(dialerSurfaceId);
11721169 tryCompare(panel, "fullscreenMode", false);
11731170 ApplicationManager.requestFocusApplication(cameraApp.appId);
11741171 tryCompare(panel, "fullscreenMode", true);
@@ -2037,7 +2034,7 @@ Rectangle {
20372034 waitForRendering(shell)
20382035
20392036 // Make sure the newly started one is at index 0 again
2040− tryCompare(topLevelSurfaceList.applicationAt(0), "appId", application.appId);
2037+ tryCompareFunction(function () { return topLevelSurfaceList.applicationAt(0).appId; }, application.appId);
20412038
20422039 appDelegate = appRepeater.itemAt(0);
20432040 compare(appDelegate.y >= PanelState.panelHeight, true);