@@ -23,24 +23,31 @@ import Unity.Test 0.1
23import Utils 0.1
23import Utils 0.1
25import "../../../qml/Stages"
25import "../../../qml/Stages"
26+import "../../../qml/Components"
29 width: desktopStageLoader.width + controls.width
30 width: desktopStageLoader.width + controls.width
30 height: desktopStageLoader.height
31 height: desktopStageLoader.height
33+ property var greeter: { fullyShown: true }
33 target: MouseTouchAdaptor
36 target: MouseTouchAdaptor
34 property: "enabled"
37 property: "enabled"
35 value: false
38 value: false
38− Component.onCompleted: {
41+ Component.onCompleted: resetGeometry()
43+ function resetGeometry() {
39 // ensures apps which are tested decorations are in view.
44 // ensures apps which are tested decorations are in view.
45+ WindowStateStorage.clear();
40 WindowStateStorage.geometry = {
46 WindowStateStorage.geometry = {
41 'unity8-dash': Qt.rect(0, units.gu(3), units.gu(50), units.gu(40)),
47 'unity8-dash': Qt.rect(0, units.gu(3), units.gu(50), units.gu(40)),
42 'dialer-app': Qt.rect(units.gu(51), units.gu(3), units.gu(50), units.gu(40)),
48 'dialer-app': Qt.rect(units.gu(51), units.gu(3), units.gu(50), units.gu(40)),
43 'camera-app': Qt.rect(0, units.gu(44), units.gu(50), units.gu(40)),
49 'camera-app': Qt.rect(0, units.gu(44), units.gu(50), units.gu(40)),
50+ 'gallery-app': Qt.rect(units.gu(51), units.gu(44), units.gu(50), units.gu(40))
@@ -61,6 +68,7 @@ Item {
61 Component.onDestruction: {
68 Component.onDestruction: {
62 desktopStageLoader.itemDestroyed = true;
69 desktopStageLoader.itemDestroyed = true;
71+ orientations: Orientations {}
@@ -110,14 +118,14 @@ Item {
111 desktopStageLoader.active = true;
119 desktopStageLoader.active = true;
112 tryCompare(desktopStageLoader, "status", Loader.Ready);
120 tryCompare(desktopStageLoader, "status", Loader.Ready);
121+ root.resetGeometry();
115 function killAllRunningApps() {
124 function killAllRunningApps() {
116− while (ApplicationManager.count > 1) {
125+ while (ApplicationManager.count > 0) {
117− var appIndex = ApplicationManager.get(0).appId == "unity8-dash" ? 1 : 0
118− ApplicationManager.stopApplication(ApplicationManager.get(appIndex).appId);
126+ ApplicationManager.stopApplication(ApplicationManager.get(0).appId);
120− compare(ApplicationManager.count, 1)
128+ compare(ApplicationManager.count, 0)
123 function waitUntilAppSurfaceShowsUp(appId) {
131 function waitUntilAppSurfaceShowsUp(appId) {
@@ -210,5 +218,73 @@ Item {
210 tap(toAppDecoration);
218 tap(toAppDecoration);
211 tryCompare(ApplicationManager.findApplication(data.apps[data.focusTo]).session.surface, "activeFocus", true);
219 tryCompare(ApplicationManager.findApplication(data.apps[data.focusTo]).session.surface, "activeFocus", true);
222+ function test_minimizeApplicationHidesSurface() {
223+ var dashApp = startApplication("unity8-dash");
225+ var dashDelegate = findChild(desktopStage, "stageDelegate_unity8-dash");
226+ verify(dashDelegate);
228+ findChild(dashDelegate, "decoratedWindow").minimize();
229+ tryCompare(dashApp.session.surface, "visible", false);
232+ function test_maximizeApplicationHidesSurfacesBehindIt() {
233+ var dashApp = startApplication("unity8-dash");
234+ var dialerApp = startApplication("dialer-app");
235+ var cameraApp = startApplication("camera-app");
237+ var dashDelegate = findChild(desktopStage, "stageDelegate_unity8-dash");
238+ verify(dashDelegate);
239+ var dialerDelegate = findChild(desktopStage, "stageDelegate_dialer-app");
240+ verify(dialerDelegate);
241+ var cameraDelegate = findChild(desktopStage, "stageDelegate_camera-app");
242+ verify(cameraDelegate);
245+ findChild(dialerDelegate, "decoratedWindow").maximize();
246+ tryCompare(dialerDelegate, "visuallyMaximized", true);
248+ tryCompare(dashApp.session.surface, "visible", false);
249+ compare(cameraApp.session.surface.visible, true);
252+ findChild(dialerDelegate, "decoratedWindow").maximize();
253+ compare(dashApp.session.surface.visible, true);
254+ compare(cameraApp.session.surface.visible, true);
257+ function test_applicationsBecomeVisibleWhenOccludingAppRemoved() {
258+ var dashApp = startApplication("unity8-dash");
259+ var dashDelegate = findChild(desktopStage, "stageDelegate_unity8-dash");
260+ verify(dashDelegate);
262+ var dialerApp = startApplication("dialer-app");
263+ var dialerDelegate = findChild(desktopStage, "stageDelegate_dialer-app");
264+ verify(dialerDelegate);
266+ var cameraApp = startApplication("camera-app");
267+ var cameraDelegate = findChild(desktopStage, "stageDelegate_camera-app");
268+ verify(cameraDelegate);
269+ findChild(dialerDelegate, "decoratedWindow").maximize();
271+ var galleryApp = startApplication("gallery-app");
272+ var galleryDelegate = findChild(desktopStage, "stageDelegate_gallery-app");
273+ verify(galleryDelegate);
274+ findChild(galleryDelegate, "decoratedWindow").maximize();
276+ tryCompare(dialerDelegate, "visuallyMaximized", true);
277+ tryCompare(galleryDelegate, "visuallyMaximized", true);
279+ tryCompare(dashApp.session.surface, "visible", false);
280+ tryCompare(dialerApp.session.surface, "visible", false);
281+ tryCompare(cameraApp.session.surface, "visible", false);
283+ ApplicationManager.stopApplication("gallery-app");
285+ compare(cameraApp.session.surface.visible, true);
286+ tryCompare(dialerApp.session.surface, "visible", true);
287+ tryCompare(dashApp.session.surface, "visible", false); // still occluded by maximised dialer