@@ -1264,7 +1264,7 @@ Rectangle {
12641264 Regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1476757
12651265
12661266 Steps:
1267− 1- have a portrait-only app in foreground (eg unity8-dash)
1267+ 1- have a portrait-only app in foreground (eg primary-oriented-app)
12681268 2- launch or switch to some other application
12691269 3- right-edge swipe to show the apps spread
12701270 4- swipe up to close the current app (the one from step 2)
@@ -1282,8 +1282,10 @@ Rectangle {
12821282 function test_lockPhoneAfterClosingAppInSpreadThenUnlockAndRotate() {
12831283 loadShell("mako");
12841284
1285− compare(topLevelSurfaceList.applicationAt(0).appId, "unity8-dash");
1286− var dashSurfaceId = topLevelSurfaceList.idAt(0);
1285+ var primarySurfaceId = topLevelSurfaceList.nextId;
1286+ var primaryApp = ApplicationManager.startApplication("primary-oriented-app");
1287+ verify(primaryApp);
1288+ waitUntilAppWindowIsFullyLoaded(primarySurfaceId);
12871289
12881290 var gmailSurfaceId = topLevelSurfaceList.nextId;
12891291 var gmailApp = ApplicationManager.startApplication("gmail-webapp");
@@ -1305,7 +1307,7 @@ Rectangle {
13051307
13061308 swipeAwayGreeter();
13071309
1308− verify(isAppSurfaceFocused(dashSurfaceId))
1310+ verify(isAppSurfaceFocused(primarySurfaceId))
13091311
13101312 signalSpy.clear();
13111313 signalSpy.target = shell;