@@ -26,6 +26,7 @@ import WindowManager 1.0
2626import ".."
2727import "../../../qml/Stage"
2828import "../../../qml/Components"
29+import "../../../qml/Components/PanelState"
2930
3031Rectangle {
3132 id: root
@@ -57,6 +58,7 @@ Rectangle {
5758 mode: "stagedWithSideStage"
5859 applicationManager: ApplicationManager
5960 topLevelSurfaceList: root.topLevelSurfaceList
61+ panelState: PanelState {}
6062
6163 Component.onCompleted: {
6264 print("starting dash")
@@ -131,14 +133,15 @@ Rectangle {
131133 name: "TabletStage"
132134 when: windowShown
133135
134− readonly property alias topLevelSurfaceList: root.topLevelSurfaceList
135136 property Item sideStage: stage ? findChild(stage, "sideStage") : null
136137
137138 function init() {
138139 stageSaver.clear();
139140
141+ print("blllaaaaaaaaa")
140142 ApplicationManager.startApplication("unity8-dash");
141143 tryCompare(topLevelSurfaceList, "count", 1);
144+ print("have", topLevelSurfaceList.count, "surfaces")
142145 compare(topLevelSurfaceList.applicationAt(0).appId, "unity8-dash");
143146
144147 // this is very strange, but sometimes the test starts without
@@ -160,6 +163,8 @@ Rectangle {
160163 waitUntilAppSurfaceShowsUp(topLevelSurfaceList.idAt(0));
161164 sideStage.hideNow()
162165 tryCompare(sideStage, "x", stage.width)
166+ print("still have", topLevelSurfaceList.count, "surfaces")
167+
163168 }
164169
165170 function cleanup() {
@@ -221,7 +226,7 @@ Rectangle {
221226 tryCompare(stage, "state", "spread");
222227 }
223228
224− function swipeSurfaceUpwards(surfaceId) {
229+ function swipeSurfaceDownwards(surfaceId) {
225230 var appWindow = findAppWindowForSurfaceId(surfaceId);
226231 verify(appWindow);
227232
@@ -229,7 +234,7 @@ Rectangle {
229234 // to not be covered by other surfaces when they're all being shown in the spread
230235 touchFlick(appWindow,
231236 appWindow.width * 0.1, appWindow.height / 2,
232− appWindow.width * 0.1, -appWindow.height / 2);
237+ appWindow.width * 0.1, appWindow.height * 1.5);
233238 }
234239
235240 function dragToSideStage(surfaceId) {
@@ -327,7 +332,7 @@ Rectangle {
327332 compare(appDelegate.stage, ApplicationInfoInterface.SideStage);
328333 tryCompare(dragArea, "closeable", true);
329334
330− swipeSurfaceUpwards(dialerSurfaceId);
335+ swipeSurfaceDownwards(dialerSurfaceId);
331336
332337 // Check that dialer-app has been closed
333338
@@ -338,6 +343,8 @@ Rectangle {
338343 tryCompareFunction(function() {
339344 return ApplicationManager.findApplication(dialerCheckBox.appId);
340345 }, null);
346+
347+ stage.closeSpread();
341348 }
342349
343350 function test_suspendsAndResumesAppsInMainStage() {
@@ -655,10 +662,6 @@ Rectangle {
655662 // simulate the suspended app being killed by the out-of-memory daemon
656663 webbrowserApp.surfaceList.get(0).setLive(false);
657664
658− // wait until the surface is gone
659− tryCompare(webbrowserApp.surfaceList, "count", 0);
660− compare(topLevelSurfaceList.surfaceAt(topLevelSurfaceList.indexForId(webbrowserSurfaceId)), null);
661−
662665 switchToSurface(webbrowserSurfaceId);
663666
664667 // webbrowser should have been brought to front