@@ -553,7 +553,6 @@ Rectangle {
553 when: windowShown
553 when: windowShown
555 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
555 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
556− property QtObject topLevelSurfaceList: null
558 function init() {
557 function init() {
559 if (shellLoader.active) {
558 if (shellLoader.active) {
@@ -592,10 +591,10 @@ Rectangle {
593 waitForGreeterToStabilize();
592 waitForGreeterToStabilize();
594+ // from StageTestCase
595 topLevelSurfaceList = findInvisibleChild(shell, "topLevelSurfaceList");
595 topLevelSurfaceList = findInvisibleChild(shell, "topLevelSurfaceList");
596 verify(topLevelSurfaceList);
596 verify(topLevelSurfaceList);
598− stage = findChild(shell, "stage"); // from StageTestCase
597+ stage = findChild(shell, "stage");
600 // wait until unity8-dash is fully loaded
599 // wait until unity8-dash is fully loaded
601 tryCompare(topLevelSurfaceList, "count", 1);
600 tryCompare(topLevelSurfaceList, "count", 1);
@@ -715,12 +714,9 @@ Rectangle {
715 loadShell("phone");
714 loadShell("phone");
716 swipeAwayGreeter();
715 swipeAwayGreeter();
717 var notifications = findChild(shell, "notificationList");
716 var notifications = findChild(shell, "notificationList");
718− var appSurfaceId = topLevelSurfaceList.nextId;
719− var app = ApplicationManager.startApplication("camera-app");
717+ var appDelegate = startApplication("camera-app");
720− waitUntilAppWindowIsFullyLoaded(appSurfaceId);
721− var stage = findChild(shell, "stage")
723− var appSurface = app.surfaceList.get(0);
719+ var appSurface = appDelegate.surface;
724 verify(appSurface);
720 verify(appSurface);
726 tryCompare(appSurface, "activeFocus", true);
722 tryCompare(appSurface, "activeFocus", true);
@@ -1047,10 +1043,8 @@ Rectangle {
1047 function test_surfaceLosesActiveFocusWhilePanelIsOpen() {
1043 function test_surfaceLosesActiveFocusWhilePanelIsOpen() {
1048 loadShell("phone");
1044 loadShell("phone");
1049 swipeAwayGreeter();
1045 swipeAwayGreeter();
1050− var appSurfaceId = topLevelSurfaceList.nextId;
1051− var app = ApplicationManager.startApplication("dialer-app");
1046+ var appDelegate = startApplication("dialer-app");
1052− waitUntilAppWindowIsFullyLoaded(appSurfaceId);
1053− var appSurface = app.surfaceList.get(0);
1047+ var appSurface = appDelegate.surface;
1054 verify(appSurface);
1048 verify(appSurface);
1056 tryCompare(appSurface, "activeFocus", true);
1050 tryCompare(appSurface, "activeFocus", true);
@@ -1093,15 +1087,9 @@ Rectangle {
1093 shell.usageScenario = data.usageScenario;
1087 shell.usageScenario = data.usageScenario;
1094 swipeAwayGreeter();
1088 swipeAwayGreeter();
1096− var webAppSurfaceId = topLevelSurfaceList.nextId;
1097− var webApp = ApplicationManager.startApplication("webbrowser-app");
1090+ var appDelegate = startApplication("webbrowser-app");
1099− waitUntilAppWindowIsFullyLoaded(webAppSurfaceId);
1101− var webAppSurface = webApp.surfaceList.get(topLevelSurfaceList.indexForId(webAppSurfaceId));
1102− verify(webAppSurface);
1104− tryCompare(webAppSurface, "activeFocus", true);
1092+ tryCompare(appDelegate.surface, "activeFocus", true);
1107 function test_launchedAppKeepsActiveFocusOnUsageModeChange() {
1095 function test_launchedAppKeepsActiveFocusOnUsageModeChange() {