on xenial help sign in
extend the appropriate test for both mouse and touch cases
7173d31Lukáš Tinkl
tests/qmltests/tst_Shell.qml+22−9
@@ -2516,27 +2516,40 @@ Rectangle {
2516 tryCompare(app2Surface, "keymap", "fr");
2516 tryCompare(app2Surface, "keymap", "fr");
2517 }
2517 }
2518
2518
2519+ function test_dragPanelToRestoreMaximizedWindow_data() {
2520+ return [
2521+ { tag: "with mouse", mouse: true },
2522+ { tag: "with touch", mouse: false }
2523+ ]
2524+ }
2525+
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);
2525
2532
2526− var appSurfaceId = topLevelSurfaceList.nextId;
2527− var app = ApplicationManager.startApplication("dialer-app")
2528− waitUntilAppWindowIsFullyLoaded(appSurfaceId);
2529−
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);
2536+
2534 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
2537 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
2538+ if (data.mouse) {
2535− mouseClick(maximizeButton);
2539+ mouseClick(maximizeButton);
2540+ } else {
2541+ tap(maximizeButton);
2542+ }
2536
2543
2537 tryCompare(appDelegate, "state", "maximized");
2544 tryCompare(appDelegate, "state", "maximized");
2538
2545
2546+ if (data.mouse) {
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);
2549+ } else {
2550+ touchFlick(panel, panel.width/2, panel.height/2, panel.width/2, shell.height/3);
2551+ }
2552+
2540 tryCompare(appDelegate, "state", "restored");
2553 tryCompare(appDelegate, "state", "restored");
2541 }
2554 }
2542
2555