@@ -32,7 +32,7 @@ Item {
32 property var greeter: { fullyShown: true }
32 property var greeter: { fullyShown: true }
35− id: phoneStage
35+ id: stage
36 anchors { fill: parent; rightMargin: units.gu(30) }
36 anchors { fill: parent; rightMargin: units.gu(30) }
37 focus: true
37 focus: true
38 dragAreaWidth: units.gu(2)
38 dragAreaWidth: units.gu(2)
@@ -67,9 +67,9 @@ Item {
67 id: edgeBarrierControls
67 id: edgeBarrierControls
68 text: "Drag here to pull out spread"
68 text: "Drag here to pull out spread"
69 backgroundColor: "blue"
69 backgroundColor: "blue"
70− onDragged: { phoneStage.pushRightEdge(amount); }
70+ onDragged: { stage.pushRightEdge(amount); }
71 Component.onCompleted: {
71 Component.onCompleted: {
72− edgeBarrierControls.target = testCase.findChild(phoneStage, "edgeBarrierController");
72+ edgeBarrierControls.target = testCase.findChild(stage, "edgeBarrierController");
75 Repeater {
75 Repeater {
@@ -85,11 +85,37 @@ Item {
85 name: "PhoneStage"
85 name: "PhoneStage"
86 when: windowShown
86 when: windowShown
89+ // wait until unity8-dash is up and running.
90+ // it's started automatically by ApplicationManager mock implementation
91+ tryCompare(ApplicationManager, "count", 1);
92+ var dashApp = ApplicationManager.findApplication("unity8-dash");
94+ tryCompare(dashApp, "state", ApplicationInfoInterface.Running);
98+ ApplicationManager.requestFocusApplication("unity8-dash");
99+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
100+ tryCompare(stage, "state", "staged");
101+ waitForRendering(stage);
104+ // wait for Stage to stabilize back into its initial state
105+ var appRepeater = findChild(stage, "appRepeater");
106+ tryCompare(appRepeater, "count", 1);
107+ tryCompare(appRepeater.itemAt(0), "x", 0);
109+ stage.shellOrientationAngle = 0;
111+ waitForRendering(stage)
88 function findAppWindowForSurfaceId(surfaceId) {
114 function findAppWindowForSurfaceId(surfaceId) {
89 var delegateObjectName = "appDelegate_" + surfaceId;
115 var delegateObjectName = "appDelegate_" + surfaceId;
90− var spreadDelegate = findChild(phoneStage, delegateObjectName);
116+ var spreadDelegate = findChild(stage, delegateObjectName);
91 if (!spreadDelegate) {
117 if (!spreadDelegate) {
92− console.warn("Failed to find " + delegateObjectName + " in phoneStage ("+phoneStage+")");
118+ console.warn("Failed to find " + delegateObjectName + " in stage");
93 return null;
119 return null;
95 var appWindow = findChild(spreadDelegate, "appWindow");
121 var appWindow = findChild(spreadDelegate, "appWindow");
@@ -109,31 +135,29 @@ Item {
109 function addApps(count) {
135 function addApps(count) {
110 if (count == undefined) count = 1;
136 if (count == undefined) count = 1;
111 for (var i = 0; i < count; i++) {
137 for (var i = 0; i < count; i++) {
138+ var startingAppId = ApplicationManager.availableApplications[ApplicationManager.count];
112 var appSurfaceId = topLevelSurfaceList.nextId;
139 var appSurfaceId = topLevelSurfaceList.nextId;
113− var app = ApplicationManager.startApplication(ApplicationManager.availableApplications[ApplicationManager.count])
140+ var app = ApplicationManager.startApplication(startingAppId)
114 tryCompare(app, "state", ApplicationInfoInterface.Running)
141 tryCompare(app, "state", ApplicationInfoInterface.Running)
115 waitUntilAppSurfaceShowsUp(appSurfaceId);
142 waitUntilAppSurfaceShowsUp(appSurfaceId);
116− waitForRendering(phoneStage)
143+ waitForRendering(stage)
144+ tryCompare(ApplicationManager, "focusedApplicationId", startingAppId)
120 function performEdgeSwipeToShowAppSpread() {
148 function performEdgeSwipeToShowAppSpread() {
121− var spreadView = findChild(phoneStage, "spreadView");
123− // Keep it inside the PhoneStage otherwise the controls on the right side will
149+ // Keep it inside the Stage otherwise the controls on the right side will
124 // capture the press thus the "- 2" on startX.
150 // capture the press thus the "- 2" on startX.
125− var startX = phoneStage.width - 2;
151+ var startX = stage.width - 2;
126− var startY = phoneStage.height / 2;
152+ var startY = stage.height / 2;
127 var endY = startY;
153 var endY = startY;
128− var endX = phoneStage.width / 2;
154+ var endX = stage.width / 2;
130− touchFlick(phoneStage, startX, startY, endX, endY,
156+ touchFlick(stage, startX, startY, endX, endY,
131 true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
157 true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
133− tryCompare(spreadView, "phase", 2);
159+ tryCompare(stage, "state", "spread");
134− tryCompare(spreadView, "flicking", false);
135− tryCompare(spreadView, "moving", false);
136− waitForRendering(phoneStage);
160+ waitForRendering(stage);
139 function swipeSurfaceUpwards(surfaceId) {
163 function swipeSurfaceUpwards(surfaceId) {
@@ -162,7 +186,7 @@ Item {
163 function waitUntilAppDelegateStopsMoving(targetSurfaceId)
187 function waitUntilAppDelegateStopsMoving(targetSurfaceId)
165− var targetAppDelegate = findChild(phoneStage, "spreadDelegate_" + targetSurfaceId);
189+ var targetAppDelegate = findChild(stage, "appDelegate_" + targetSurfaceId);
166 verify(targetAppDelegate);
190 verify(targetAppDelegate);
167 var lastValue = undefined;
191 var lastValue = undefined;
@@ -171,79 +195,40 @@ Item {
171 } while (lastValue != targetAppDelegate.animatedProgress);
195 } while (lastValue != targetAppDelegate.animatedProgress);
174− function test_shortFlick() {
176− var startX = phoneStage.width - units.gu(1);
177− var startY = phoneStage.height / 2;
178− var endX = startX - units.gu(4);
181− var activeApp = ApplicationManager.get(0);
182− var inactiveApp = ApplicationManager.get(1);
184− touchFlick(phoneStage, startX, startY, endX, endY,
185− true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
187− tryCompare(ApplicationManager, "focusedApplicationId", inactiveApp.appId)
189− touchFlick(phoneStage, startX, startY, endX, endY,
190− true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
192− tryCompare(ApplicationManager, "focusedApplicationId", activeApp.appId)
195 function test_enterSpread_data() {
198 function test_enterSpread_data() {
197− {tag: "<position1 (linear movement)", positionMarker: "positionMarker1", linear: true, offset: 0, endPhase: 0, targetPhase: 0, newFocusedIndex: 1 },
200+ {tag: "<breakPoint (trigger)", progress: .2, cancel: false, endState: "staged", newFocusedIndex: 1 },
198− {tag: "<position1 (non-linear movement)", positionMarker: "positionMarker1", linear: false, offset: 0, endPhase: 0, targetPhase: 0, newFocusedIndex: 0 },
201+ {tag: "<breakPoint (cancel)", progress: .2, cancel: true, endState: "staged", newFocusedIndex: 0 },
199− {tag: ">position1", positionMarker: "positionMarker1", linear: true, offset: +5, endPhase: 0, targetPhase: 0, newFocusedIndex: 1 },
202+ {tag: ">breakPoint (trigger)", progress: .5, cancel: false, endState: "spread", newFocusedIndex: 0 },
200− {tag: "<position2 (linear)", positionMarker: "positionMarker2", linear: true, offset: 0, endPhase: 0, targetPhase: 0, newFocusedIndex: 1 },
203+ {tag: ">breakPoint (cancel)", progress: .8, cancel: true, endState: "staged", newFocusedIndex: 0 },
201− {tag: "<position2 (non-linear)", positionMarker: "positionMarker2", linear: false, offset: 0, endPhase: 0, targetPhase: 0, newFocusedIndex: 1 },
202− {tag: ">position2", positionMarker: "positionMarker2", linear: true, offset: +5, endPhase: 1, targetPhase: 0, newFocusedIndex: 1 },
203− {tag: "<position3", positionMarker: "positionMarker3", linear: true, offset: 0, endPhase: 1, targetPhase: 0, newFocusedIndex: 1 },
204− {tag: ">position3", positionMarker: "positionMarker3", linear: true, offset: +5, endPhase: 1, targetPhase: 2, newFocusedIndex: 2 },
208 function test_enterSpread(data) {
207 function test_enterSpread(data) {
209 addApps(5)
208 addApps(5)
211− var spreadView = findChild(phoneStage, "spreadView");
213− // Keep it inside the PhoneStage otherwise the controls on the right side will
210+ // Keep it inside the Stage otherwise the controls on the right side will
214 // capture the press thus the "- 2" on startX.
211 // capture the press thus the "- 2" on startX.
215− var startX = phoneStage.width - 2;
212+ var startX = stage.width - 2;
216− var startY = phoneStage.height / 2;
213+ var startY = stage.height / 2;
217 var endY = startY;
214 var endY = startY;
218− var endX = spreadView.width - (spreadView.width * spreadView[data.positionMarker]) - data.offset
215+ var endX = stage.width - (stage.width * data.progress) - stage.dragAreaWidth;
219− - phoneStage.dragAreaWidth;
221 var oldFocusedApp = ApplicationManager.get(0);
217 var oldFocusedApp = ApplicationManager.get(0);
222 var newFocusedApp = ApplicationManager.get(data.newFocusedIndex);
218 var newFocusedApp = ApplicationManager.get(data.newFocusedIndex);
224− touchFlick(phoneStage, startX, startY, endX, endY,
220+ touchFlick(stage, startX, startY, endX, endY,
225 true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
221 true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
227− tryCompare(spreadView, "phase", data.endPhase)
229− if (!data.linear) {
223+ if (data.cancel) {
230− touchFlick(phoneStage, endX, endY, endX + units.gu(.5), endY,
224+ touchFlick(stage, endX, endY, endX + units.gu(5), endY,
231− false /* beginTouch */, false /* endTouch */, units.gu(10), 50);
225+ false /* beginTouch */, true /* endTouch */, units.gu(10), 50);
232− touchFlick(phoneStage, endY + units.gu(.5), endY, endX, endY,
226+ } else {
233− false /* beginTouch */, false /* endTouch */, units.gu(10), 50);
227+ touchRelease(stage, endX, endY);
236− touchRelease(phoneStage, endX, endY);
230+ tryCompare(stage, "state", data.endState);
238− tryCompare(spreadView, "phase", data.targetPhase)
240− if (data.targetPhase == 2) {
241− var app2 = findChild(spreadView, "spreadDelegate_" + topLevelSurfaceList.idAt(2));
242− tryCompare(app2, "swipeToCloseEnabled", true);
243− mouseClick(app2, units.gu(1), units.gu(1));
246− tryCompare(ApplicationManager, "focusedApplicationId", newFocusedApp.appId);
231+ tryCompare(ApplicationManager, "focusedApplicationId", data.endState == "spread" ? "" : newFocusedApp.appId);
249 function test_selectAppFromSpread_data() {
234 function test_selectAppFromSpread_data() {
@@ -262,32 +247,26 @@ Item {
262 function test_selectAppFromSpread(data) {
247 function test_selectAppFromSpread(data) {
263 addApps(data.total)
248 addApps(data.total)
265− var spreadView = findChild(phoneStage, "spreadView");
267 performEdgeSwipeToShowAppSpread();
250 performEdgeSwipeToShowAppSpread();
269− tryCompare(spreadView, "phase", 2);
271− var tile = findChild(spreadView, "spreadDelegate_" + topLevelSurfaceList.idAt(data.index));
252+ var tile = findChild(stage, "appDelegate_" + topLevelSurfaceList.idAt(data.index));
272 var appId = ApplicationManager.get(data.index).appId;
253 var appId = ApplicationManager.get(data.index).appId;
274− if (tile.mapToItem(spreadView, 0, 0).x > spreadView.width) {
255+ if (tile.mapToItem(stage, 0, 0).x > stage.width) {
275 // Item is not visible... Need to flick the spread
256 // Item is not visible... Need to flick the spread
276− var startX = phoneStage.width - units.gu(1);
257+ var startX = stage.width - units.gu(1);
277− var startY = phoneStage.height / 2;
258+ var startY = stage.height / 2;
278 var endY = startY;
259 var endY = startY;
279 var endX = units.gu(2);
260 var endX = units.gu(2);
280− touchFlick(phoneStage, startX, startY, endX, endY, true, true, units.gu(10), 50)
261+ touchFlick(stage, startX, startY, endX, endY, true, true, units.gu(10), 50)
281− tryCompare(spreadView, "flicking", false);
282− tryCompare(spreadView, "moving", false);
283−// waitForRendering(phoneStage);
286 console.log("clicking app", data.index, "(", appId, ")")
264 console.log("clicking app", data.index, "(", appId, ")")
265+ var dragArea = findChild(tile, "dragArea");
287− tryCompare(tile, "swipeToCloseEnabled", true);
266+ tryCompare(dragArea, "closeable", true);
288− mouseClick(spreadView, tile.mapToItem(spreadView, 0, 0).x + units.gu(1), spreadView.height / 2)
267+ mouseClick(stage, tile.mapToItem(stage, 0, 0).x + units.gu(1), stage.height / 2)
289 tryCompare(ApplicationManager, "focusedApplicationId", appId);
268 tryCompare(ApplicationManager, "focusedApplicationId", appId);
290− tryCompare(spreadView, "phase", 0);
269+ tryCompare(stage, "state", "staged");
293 function test_select_data() {
272 function test_select_data() {
@@ -301,12 +280,12 @@ Item {
301 function test_select(data) {
280 function test_select(data) {
302 addApps(5);
281 addApps(5);
304− var spreadView = findChild(phoneStage, "spreadView");
283+ var spreadView = findChild(stage, "spreadView");
305 var selectedApp = ApplicationManager.get(data.index);
284 var selectedApp = ApplicationManager.get(data.index);
307 performEdgeSwipeToShowAppSpread();
286 performEdgeSwipeToShowAppSpread();
309− phoneStage.select(selectedApp.appId);
288+ stage.select(selectedApp.appId);
311 tryCompare(spreadView, "contentX", -spreadView.shift);
290 tryCompare(spreadView, "contentX", -spreadView.shift);
@@ -319,37 +298,14 @@ Item {
319 var focusedAppId = ApplicationManager.focusedApplicationId;
298 var focusedAppId = ApplicationManager.focusedApplicationId;
321 performEdgeSwipeToShowAppSpread();
300 performEdgeSwipeToShowAppSpread();
301+ tryCompare(stage, "state", "spread");
323− mouseClick(phoneStage, units.gu(1), units.gu(1));
303+ mouseClick(stage, units.gu(1), units.gu(1));
325− // Make sure the spread is in the idle position
305+ tryCompare(stage, "state", "staged");
326− var spreadView = findChild(phoneStage, "spreadView");
327− tryCompare(spreadView, "contentX", -spreadView.shift);
329 // Make sure the same app is still focused
307 // Make sure the same app is still focused
330− compare(focusedAppId, ApplicationManager.focusedApplicationId);
308+ tryCompare(ApplicationManager, "focusedApplicationId", focusedAppId);
334− // wait until unity8-dash is up and running.
335− // it's started automatically by ApplicationManager mock implementation
336− tryCompare(ApplicationManager, "count", 1);
337− var dashApp = ApplicationManager.findApplication("unity8-dash");
339− tryCompare(dashApp, "state", ApplicationInfoInterface.Running);
342− function cleanup() {
345− phoneStage.shellOrientationAngle = 0;
346− phoneStage.select(ApplicationManager.get(0).appId);
348− // wait for PhoneStage to stabilize back into its initial state
349− var spreadView = findChild(phoneStage, "spreadView");
350− while (spreadView.phase !== 0 || spreadView.contentX !== -spreadView.shift || spreadView.selectedIndex != -1) {
355 function test_focusNewTopMostAppAfterFocusedOneClosesItself() {
311 function test_focusNewTopMostAppAfterFocusedOneClosesItself() {
@@ -369,57 +325,6 @@ Item {
369 tryCompare(firstApp, "focused", true);
325 tryCompare(firstApp, "focused", true);
372− function test_cantCloseWhileSnapping() {
375− performEdgeSwipeToShowAppSpread();
377− var spreadView = findChild(phoneStage, "spreadView");
378− var selectedApp = ApplicationManager.get(2);
380− performEdgeSwipeToShowAppSpread();
382− var app0 = findChild(spreadView, "spreadDelegate_" + topLevelSurfaceList.idAt(0));
383− var app1 = findChild(spreadView, "spreadDelegate_" + topLevelSurfaceList.idAt(1));
384− var app2 = findChild(spreadView, "spreadDelegate_" + topLevelSurfaceList.idAt(2));
386− var dragArea0 = findChild(app0, "dragArea");
387− var dragArea1 = findChild(app1, "dragArea");
388− var dragArea2 = findChild(app2, "dragArea");
390− compare(dragArea0.enabled, true);
391− compare(dragArea1.enabled, true);
392− compare(dragArea2.enabled, true);
394− phoneStage.select(selectedApp.appId);
396− // Make sure all drag areas are disabled instantly. Don't use tryCompare here!
397− compare(dragArea0.enabled, false);
398− compare(dragArea1.enabled, false);
399− compare(dragArea2.enabled, false);
401− tryCompare(spreadView, "contentX", -spreadView.shift)
404− function test_cantAccessPhoneStageWhileRightEdgeGesture() {
405− var spreadView = findChild(phoneStage, "spreadView");
406− var eventEaterArea = findChild(phoneStage, "eventEaterArea")
408− var startX = phoneStage.width - 2;
409− var startY = phoneStage.height / 2;
411− var endX = phoneStage.width / 2;
413− touchFlick(phoneStage, startX, startY, endX, endY,
414− true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
416− compare(eventEaterArea.enabled, true);
418− touchRelease(phoneStage, endX, endY);
420− compare(eventEaterArea.enabled, false);
423 function test_leftEdge_data() {
328 function test_leftEdge_data() {
425 { tag: "normal", inSpread: false, leftEdgeDragWidth: units.gu(5), shouldMoveApp: true },
330 { tag: "normal", inSpread: false, leftEdgeDragWidth: units.gu(5), shouldMoveApp: true },
@@ -434,12 +339,12 @@ Item {
434 performEdgeSwipeToShowAppSpread();
339 performEdgeSwipeToShowAppSpread();
437− var focusedDelegate = findChild(phoneStage, "spreadDelegate_" + topLevelSurfaceList.idAt(0));
342+ var focusedDelegate = findChild(stage, "appDelegate_" + topLevelSurfaceList.idAt(0));
438− phoneStage.inverseProgress = data.leftEdgeDragWidth;
343+ stage.inverseProgress = data.leftEdgeDragWidth;
440 tryCompare(focusedDelegate, "x", data.shouldMoveApp ? data.leftEdgeDragWidth : 0);
345 tryCompare(focusedDelegate, "x", data.shouldMoveApp ? data.leftEdgeDragWidth : 0);
442− phoneStage.inverseProgress = 0;
347+ stage.inverseProgress = 0;
444 tryCompare(focusedDelegate, "x", 0);
349 tryCompare(focusedDelegate, "x", 0);
@@ -447,9 +352,9 @@ Item {
447 function test_focusedAppIsTheOnlyRunningApp() {
352 function test_focusedAppIsTheOnlyRunningApp() {
448 addApps(2);
353 addApps(2);
450− var delegateA = findChild(phoneStage, "spreadDelegate_" + topLevelSurfaceList.idAt(0));
355+ var delegateA = findChild(stage, "appDelegate_" + topLevelSurfaceList.idAt(0));
451 verify(delegateA);
356 verify(delegateA);
452− var delegateB = findChild(phoneStage, "spreadDelegate_" + topLevelSurfaceList.idAt(1));
357+ var delegateB = findChild(stage, "appDelegate_" + topLevelSurfaceList.idAt(1));
453 verify(delegateB);
358 verify(delegateB);
455 // A is focused and running, B is unfocused and suspended
360 // A is focused and running, B is unfocused and suspended
@@ -460,7 +365,7 @@ Item {
461 // Switch foreground/focused appp from A to B
366 // Switch foreground/focused appp from A to B
462 performEdgeSwipeToShowAppSpread();
367 performEdgeSwipeToShowAppSpread();
463− phoneStage.select(delegateB.application.appId);
368+ stage.select(delegateB.application.appId);
465 // Now it's the other way round
370 // Now it's the other way round
466 // A is unfocused and suspended, B is focused and running
371 // A is unfocused and suspended, B is focused and running
@@ -473,15 +378,15 @@ Item {
473 function test_dashRemainsRunningIfStageIsToldSo() {
378 function test_dashRemainsRunningIfStageIsToldSo() {
474 addApps(1);
379 addApps(1);
476− var delegateDash = findChild(phoneStage, "spreadDelegate_" + topLevelSurfaceList.idAt(1));
381+ var delegateDash = findChild(stage, "appDelegate_" + topLevelSurfaceList.idAt(1));
477 verify(delegateDash);
382 verify(delegateDash);
478 compare(delegateDash.application.appId, "unity8-dash");
383 compare(delegateDash.application.appId, "unity8-dash");
480− var delegateOther = findChild(phoneStage, "spreadDelegate_" + topLevelSurfaceList.idAt(0));
385+ var delegateOther = findChild(stage, "appDelegate_" + topLevelSurfaceList.idAt(0));
481 verify(delegateOther);
386 verify(delegateOther);
483 performEdgeSwipeToShowAppSpread();
388 performEdgeSwipeToShowAppSpread();
484− phoneStage.select("unity8-dash");
389+ tap(delegateDash, 1, 1);
486 tryCompare(delegateDash, "focus", true);
391 tryCompare(delegateDash, "focus", true);
487 tryCompare(delegateDash.application, "requestedState", ApplicationInfoInterface.RequestedRunning);
392 tryCompare(delegateDash.application, "requestedState", ApplicationInfoInterface.RequestedRunning);
@@ -489,39 +394,38 @@ Item {
489 compare(delegateOther.application.requestedState, ApplicationInfoInterface.RequestedSuspended);
394 compare(delegateOther.application.requestedState, ApplicationInfoInterface.RequestedSuspended);
491 performEdgeSwipeToShowAppSpread();
396 performEdgeSwipeToShowAppSpread();
492− phoneStage.select(delegateOther.application.appId);
397+ tap(delegateOther, 1, 1);
494 // The other app gets focused and running but dash is kept running despite being unfocused
398 // The other app gets focused and running but dash is kept running despite being unfocused
399+ tryCompare(delegateOther, "focus", true);
400+ tryCompare(delegateOther.application, "requestedState", ApplicationInfoInterface.RequestedRunning);
495 tryCompare(delegateDash, "focus", false);
401 tryCompare(delegateDash, "focus", false);
496 tryCompare(delegateDash.application, "requestedState", ApplicationInfoInterface.RequestedRunning);
402 tryCompare(delegateDash.application, "requestedState", ApplicationInfoInterface.RequestedRunning);
497− compare(delegateOther.focus, true);
498− compare(delegateOther.application.requestedState, ApplicationInfoInterface.RequestedRunning);
501 function test_foregroundAppIsSuspendedWhenStageIsSuspended() {
405 function test_foregroundAppIsSuspendedWhenStageIsSuspended() {
502 addApps(1);
406 addApps(1);
504− var delegate = findChild(phoneStage, "spreadDelegate_" + topLevelSurfaceList.idAt(0));
408+ var delegate = findChild(stage, "appDelegate_" + topLevelSurfaceList.idAt(0));
505 verify(delegate);
409 verify(delegate);
507 compare(delegate.focus, true);
411 compare(delegate.focus, true);
508 compare(delegate.application.requestedState, ApplicationInfoInterface.RequestedRunning);
412 compare(delegate.application.requestedState, ApplicationInfoInterface.RequestedRunning);
510− phoneStage.suspended = true;
414+ stage.suspended = true;
512 tryCompare(delegate.application, "requestedState", ApplicationInfoInterface.RequestedSuspended);
416 tryCompare(delegate.application, "requestedState", ApplicationInfoInterface.RequestedSuspended);
514− phoneStage.suspended = false;
418+ stage.suspended = false;
516 tryCompare(delegate.application, "requestedState", ApplicationInfoInterface.RequestedRunning);
420 tryCompare(delegate.application, "requestedState", ApplicationInfoInterface.RequestedRunning);
519 function test_mouseEdgePush() {
423 function test_mouseEdgePush() {
520− var spreadView = findChild(phoneStage, "spreadView")
424+ var spreadView = findChild(stage, "spreadView")
521 addApps(1);
425 addApps(1);
522− mouseMove(phoneStage, phoneStage.width - 1, units.gu(10));
426+ mouseMove(stage, stage.width - 1, units.gu(10));
523 for (var i = 0; i < units.gu(10); i++) {
427 for (var i = 0; i < units.gu(10); i++) {
524− phoneStage.pushRightEdge(1);
428+ stage.pushRightEdge(1);
526 tryCompare(spreadView, "phase", 2);
430 tryCompare(spreadView, "phase", 2);
@@ -538,19 +442,18 @@ Item {
539 performEdgeSwipeToShowAppSpread();
443 performEdgeSwipeToShowAppSpread();
541− var appDelegate = findChild(phoneStage, "spreadDelegate_" + surface1Id);
445+ var appDelegate = findChild(stage, "appDelegate_" + surface1Id);
542− verify(appDelegate);
446+ var dragArea = findChild(appDelegate, "dragArea")
543− tryCompare(appDelegate, "swipeToCloseEnabled", true);
447+ verify(dragArea);
448+ tryCompare(dragArea, "closeable", true);
545 compare(webbrowserApp.surfaceList.count, 2);
450 compare(webbrowserApp.surfaceList.count, 2);
546− compare(webbrowserApp.state, ApplicationInfoInterface.Running);
548 swipeSurfaceUpwards(surface1Id);
452 swipeSurfaceUpwards(surface1Id);
550 // Surface must eventually be gone
454 // Surface must eventually be gone
551 tryCompareFunction(function() { return topLevelSurfaceList.indexForId(surface1Id); }, -1);
455 tryCompareFunction(function() { return topLevelSurfaceList.indexForId(surface1Id); }, -1);
552 tryCompare(webbrowserApp.surfaceList, "count", 1);
456 tryCompare(webbrowserApp.surfaceList, "count", 1);
553− compare(webbrowserApp.state, ApplicationInfoInterface.Running);
@@ -631,11 +534,10 @@ Item {
632 performEdgeSwipeToShowAppSpread();
535 performEdgeSwipeToShowAppSpread();
635− var appDelegate = findChild(phoneStage, "spreadDelegate_" + webbrowserSurfaceId);
537+ var appDelegate = findChild(stage, "appDelegate_" + webbrowserSurfaceId);
636− verify(appDelegate);
538+ var dragArea = findChild(appDelegate, "dragArea");
637− tryCompare(appDelegate, "swipeToCloseEnabled", true);
539+ verify(dragArea);
638− }
540+ tryCompare(dragArea, "closeable", true);
640 swipeSurfaceUpwards(webbrowserSurfaceId);
542 swipeSurfaceUpwards(webbrowserSurfaceId);