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