@@ -3183,6 +3183,58 @@ Rectangle {
31833183 keyRelease(Qt.Key_Alt);
31843184 }
31853185
3186+ function test_maximizedWindowMenuThenAltTab_data() {
3187+ return [
3188+ { tag: "show spread", showSpread: true },
3189+ { tag: "do not show spread", showSpread: false },
3190+ ];
3191+ }
3192+
3193+ function test_maximizedWindowMenuThenAltTab(data) {
3194+ loadShell("desktop");
3195+ shell.usageScenario = "desktop";
3196+ waitForRendering(shell);
3197+ swipeAwayGreeter();
3198+
3199+ var appDelegate = startApplication("gmail-webapp");
3200+ var appDelegate2 = startApplication("dialer-app");
3201+
3202+ var maximizeButton = findChild(appDelegate2, "maximizeWindowButton");
3203+ mouseClick(maximizeButton);
3204+ tryCompare(appDelegate2, "state", "maximized");
3205+
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);
3220+
3221+ keyPress(Qt.Key_Alt);
3222+ keyClick(Qt.Key_Tab);
3223+ if (data.showSpread) {
3224+ tryCompare(stage, "spreadShown", true);
3225+ }
3226+ tryCompareFunction(function() { return menuBarLoader.active === false; }, true);
3227+ keyRelease(Qt.Key_Alt)
3228+
3229+ tryCompare(appDelegate.surface, "activeFocus", true);
3230+
3231+ keyPress(Qt.Key_Alt);
3232+ keyClick(Qt.Key_Tab);
3233+ keyRelease(Qt.Key_Alt)
3234+
3235+ tryCompare(appDelegate2.surface, "activeFocus", true);
3236+ }
3237+
31863238 function test_maximizedWindowAndMenuInPanel() {
31873239 loadShell("desktop");
31883240 shell.usageScenario = "desktop";