@@ -460,5 +460,45 @@ Item {
460460 compare(dialerDelegate.visible, true, "Dialer should be visible");
461461 compare(dashDelegate.visible, true, "Dash should still be visible");
462462 }
463+
464+ function test_occlusionWithMultipleMaximized() {
465+ var dashApp = startApplication("unity8-dash");
466+ var dashAppDelegate = findChild(desktopStage, "appDelegate_unity8-dash");
467+
468+ var dialerApp = startApplication("dialer-app");
469+ var dialerAppDelegate = findChild(desktopStage, "appDelegate_dialer-app");
470+
471+ var facebookApp = startApplication("facebook-webapp");
472+ var facebookAppDelegate = findChild(desktopStage, "appDelegate_facebook-webapp");
473+
474+ // all of them are in restored state now. all should be visible
475+ tryCompare(dashAppDelegate, "visible", true);
476+ tryCompare(dialerAppDelegate, "visible", true);
477+ tryCompare(facebookAppDelegate, "visible", true);
478+
479+ // Maximize the topmost and make sure the other two are hidden
480+ facebookAppDelegate.maximize();
481+ tryCompare(dashAppDelegate, "visible", false);
482+ tryCompare(dialerAppDelegate, "visible", false);
483+ tryCompare(facebookAppDelegate, "visible", true);
484+
485+ // Bring dash to front. make sure dash and the maximized facebook are visible, the restored one behind is hidden
486+ ApplicationManager.focusApplication("unity8-dash");
487+ tryCompare(dashAppDelegate, "visible", true);
488+ tryCompare(dialerAppDelegate, "visible", false);
489+ tryCompare(facebookAppDelegate, "visible", true);
490+
491+ // Now focus the dialer app. all 3 should be visible again
492+ ApplicationManager.focusApplication("dialer-app");
493+ tryCompare(dashAppDelegate, "visible", true);
494+ tryCompare(dialerAppDelegate, "visible", true);
495+ tryCompare(facebookAppDelegate, "visible", true);
496+
497+ // Maximize the dialer app. The other 2 should hide
498+ dialerAppDelegate.maximize();
499+ tryCompare(dashAppDelegate, "visible", false);
500+ tryCompare(dialerAppDelegate, "visible", true);
501+ tryCompare(facebookAppDelegate, "visible", false);
502+ }
463503 }
464504}