on xenial help sign in
extend the appropriate test for both mouse and touch cases
commit7173d31f94c0350d054ec79989ecf8b93c0f169c authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 10 Mar 2017, 16:48 (10 years ago) parentb3745d6
1 file changed+22−9
tests/qmltests/tst_Shell.qml+22−9
tests/qmltests/tst_Shell.qml+22−9
@@ -2516,27 +2516,40 @@ Rectangle {
25162516 tryCompare(app2Surface, "keymap", "fr");
25172517 }
25182518
2519− function test_dragPanelToRestoreMaximizedWindow() {
2519+ function test_dragPanelToRestoreMaximizedWindow_data() {
2520+ return [
2521+ { tag: "with mouse", mouse: true },
2522+ { tag: "with touch", mouse: false }
2523+ ]
2524+ }
2525+
2526+ function test_dragPanelToRestoreMaximizedWindow(data) {
25202527 loadShell("desktop");
25212528 shell.usageScenario = "desktop";
25222529 waitForRendering(shell);
25232530 var panel = findChild(shell, "windowControlArea");
25242531 verify(panel);
25252532
2526− var appSurfaceId = topLevelSurfaceList.nextId;
2527− var app = ApplicationManager.startApplication("dialer-app")
2528− waitUntilAppWindowIsFullyLoaded(appSurfaceId);
2529−
25302533 // start dialer, maximize it
2531− var appContainer = findChild(shell, "appContainer");
2532− var appDelegate = findChild(appContainer, "appDelegate_" + appSurfaceId);
2534+ var appDelegate = startApplication("dialer-app");
25332535 verify(appDelegate);
2536+
25342537 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
2535− mouseClick(maximizeButton);
2538+ if (data.mouse) {
2539+ mouseClick(maximizeButton);
2540+ } else {
2541+ tap(maximizeButton);
2542+ }
25362543
25372544 tryCompare(appDelegate, "state", "maximized");
25382545
2539− mouseDrag(panel, panel.width/2, panel.height/2, 0, shell.height/3, Qt.LeftButton, Qt.NoModifier, 500);
2546+ if (data.mouse) {
2547+ mouseMove(panel, panel.width/2, panel.panelHeight/2, 200 /* delay */); // to reveal the menus
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+
25402553 tryCompare(appDelegate, "state", "restored");
25412554 }
25422555