@@ -2516,27 +2516,40 @@ Rectangle {
2516 tryCompare(app2Surface, "keymap", "fr");
2516 tryCompare(app2Surface, "keymap", "fr");
2519+ function test_dragPanelToRestoreMaximizedWindow_data() {
2521+ { tag: "with mouse", mouse: true },
2522+ { tag: "with touch", mouse: false }
2519− function test_dragPanelToRestoreMaximizedWindow() {
2526+ function test_dragPanelToRestoreMaximizedWindow(data) {
2520 loadShell("desktop");
2527 loadShell("desktop");
2521 shell.usageScenario = "desktop";
2528 shell.usageScenario = "desktop";
2522 waitForRendering(shell);
2529 waitForRendering(shell);
2523 var panel = findChild(shell, "windowControlArea");
2530 var panel = findChild(shell, "windowControlArea");
2524 verify(panel);
2531 verify(panel);
2526− var appSurfaceId = topLevelSurfaceList.nextId;
2527− var app = ApplicationManager.startApplication("dialer-app")
2528− waitUntilAppWindowIsFullyLoaded(appSurfaceId);
2530 // start dialer, maximize it
2533 // start dialer, maximize it
2531− var appContainer = findChild(shell, "appContainer");
2534+ var appDelegate = startApplication("dialer-app");
2532− var appDelegate = findChild(appContainer, "appDelegate_" + appSurfaceId);
2533 verify(appDelegate);
2535 verify(appDelegate);
2534 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
2537 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
2535− mouseClick(maximizeButton);
2539+ mouseClick(maximizeButton);
2541+ tap(maximizeButton);
2537 tryCompare(appDelegate, "state", "maximized");
2544 tryCompare(appDelegate, "state", "maximized");
2547+ mouseMove(panel, panel.width/2, panel.panelHeight/2, 200 /* delay */); // to reveal the menus
2539− mouseDrag(panel, panel.width/2, panel.height/2, 0, shell.height/3, Qt.LeftButton, Qt.NoModifier, 500);
2548+ mouseDrag(panel, panel.width/2, panel.height/2, 0, shell.height/3, Qt.LeftButton, Qt.NoModifier, 500);
2550+ touchFlick(panel, panel.width/2, panel.height/2, panel.width/2, shell.height/3);
2540 tryCompare(appDelegate, "state", "restored");
2553 tryCompare(appDelegate, "state", "restored");