@@ -3183,6 +3183,58 @@ Rectangle {
3183 keyRelease(Qt.Key_Alt);
3183 keyRelease(Qt.Key_Alt);
3186+ function test_maximizedWindowMenuThenAltTab_data() {
3188+ { tag: "show spread", showSpread: true },
3189+ { tag: "do not show spread", showSpread: false },
3193+ function test_maximizedWindowMenuThenAltTab(data) {
3194+ loadShell("desktop");
3195+ shell.usageScenario = "desktop";
3196+ waitForRendering(shell);
3197+ swipeAwayGreeter();
3199+ var appDelegate = startApplication("gmail-webapp");
3200+ var appDelegate2 = startApplication("dialer-app");
3202+ var maximizeButton = findChild(appDelegate2, "maximizeWindowButton");
3203+ mouseClick(maximizeButton);
3204+ tryCompare(appDelegate2, "state", "maximized");
3206+ var panel = findChild(shell, "panel");
3207+ var panelMouse = findChild(panel, "windowControlArea");
3208+ mouseMove(panelMouse);
3209+ var panelMenu = findChild(panel, "menuBar");
3210+ var menuBarLoader = findChild(panel, "menuBarLoader");
3211+ mouseMove(panelMenu);
3212+ var panelMenuItem = findChild(panelMenu, "menuBar-item0");
3213+ tryCompare(panelMenuItem, "visible", true);
3214+ Util.waitForBehaviors(shell);
3215+ mouseClick(panelMenuItem);
3216+ var panelMenuItemItem = findChild(panelMenu, "menuBar-item0-menu-item0-actionItem");
3217+ mouseMove(panelMenuItemItem, panelMenuItemItem.width/2, panelMenuItemItem.height/2);
3218+ verify(panelMenuItemItem.activeFocus);
3219+ verify(panelMenuItem.__popup);
3221+ keyPress(Qt.Key_Alt);
3222+ keyClick(Qt.Key_Tab);
3223+ if (data.showSpread) {
3224+ tryCompare(stage, "spreadShown", true);
3226+ tryCompareFunction(function() { return menuBarLoader.active === false; }, true);
3227+ keyRelease(Qt.Key_Alt)
3229+ tryCompare(appDelegate.surface, "activeFocus", true);
3231+ keyPress(Qt.Key_Alt);
3232+ keyClick(Qt.Key_Tab);
3233+ keyRelease(Qt.Key_Alt)
3235+ tryCompare(appDelegate2.surface, "activeFocus", true);
3186 function test_maximizedWindowAndMenuInPanel() {
3238 function test_maximizedWindowAndMenuInPanel() {
3187 loadShell("desktop");
3239 loadShell("desktop");
3188 shell.usageScenario = "desktop";
3240 shell.usageScenario = "desktop";