@@ -3151,6 +3151,38 @@ Rectangle {
3151 tryCompare(menuBarLoader.item, "visible", true);
3151 tryCompare(menuBarLoader.item, "visible", true);
3154+ function test_enforceFocusOnStageOnAltTab() {
3155+ loadShell("desktop");
3156+ shell.usageScenario = "desktop";
3157+ waitForRendering(shell);
3158+ swipeAwayGreeter();
3160+ var appDelegate = startApplication("music-app")
3161+ verify(appDelegate);
3162+ waitForRendering(shell);
3164+ var launcher = findChild(shell, "launcher");
3165+ launcher.focus = true;
3167+ var stage = findChild(shell, "stage");
3169+ var spreadItem = findChild(shell, "spreadItem");
3171+ compare(spreadItem.highlightedIndex, -1);
3173+ keyPress(Qt.Key_Alt);
3174+ keyClick(Qt.Key_Tab);
3176+ tryCompare(spreadItem, "highlightedIndex", 1);
3177+ tryCompare(stage, "focus", true);
3179+ keyClick(Qt.Key_Tab);
3181+ tryCompare(spreadItem, "highlightedIndex", 0);
3183+ keyRelease(Qt.Key_Alt);
3154 function test_maximizedWindowAndMenuInPanel() {
3186 function test_maximizedWindowAndMenuInPanel() {
3155 loadShell("desktop");
3187 loadShell("desktop");
3156 shell.usageScenario = "desktop";
3188 shell.usageScenario = "desktop";