@@ -460,5 +460,45 @@ Item {
460 compare(dialerDelegate.visible, true, "Dialer should be visible");
460 compare(dialerDelegate.visible, true, "Dialer should be visible");
461 compare(dashDelegate.visible, true, "Dash should still be visible");
461 compare(dashDelegate.visible, true, "Dash should still be visible");
464+ function test_occlusionWithMultipleMaximized() {
465+ var dashApp = startApplication("unity8-dash");
466+ var dashAppDelegate = findChild(desktopStage, "appDelegate_unity8-dash");
468+ var dialerApp = startApplication("dialer-app");
469+ var dialerAppDelegate = findChild(desktopStage, "appDelegate_dialer-app");
471+ var facebookApp = startApplication("facebook-webapp");
472+ var facebookAppDelegate = findChild(desktopStage, "appDelegate_facebook-webapp");
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);
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);
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);
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);
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);