~ci-train-bot/unity8/unity8-ubuntu-zesty-2663

« back to all changes in this revision

Viewing changes to tests/qmltests/tst_Shell.qml

  • Committer: Nick Dedekind
  • Date: 2017-03-15 15:22:07 UTC
  • mfrom: (2868 unity8)
  • mto: This revision was merged to the branch mainline in revision 2892.
  • Revision ID: nick.dedekind@canonical.com-20170315152207-9ts6lyu1v2pruue2
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
                        primary: shellLoader.primaryOrientation
147
147
                    }
148
148
                    mode: shellLoader.mode
 
149
                    hasTouchscreen: true
149
150
                    Component.onCompleted: {
150
151
                        ApplicationManager.startApplication("unity8-dash");
151
152
                    }
348
349
 
349
350
                Row {
350
351
                    CheckBox {
351
 
                        id: fullscreeAppCheck
 
352
                        id: fullscreenAppCheck
352
353
                        activeFocusOnPress: false
353
354
                        activeFocusOnTab: false
354
355
 
362
363
                        }
363
364
 
364
365
                        Binding {
365
 
                            target: fullscreeAppCheck
 
366
                            target: fullscreenAppCheck
366
367
                            when: topLevelSurfaceList && topLevelSurfaceList.focusedWindow
367
368
                            property: "checked"
368
 
                            value: {
369
 
                                if (!topLevelSurfaceList || !topLevelSurfaceList.focusedWindow) return false;
370
 
                                return topLevelSurfaceList.focusedWindow.state === Mir.FullscreenState
371
 
                            }
 
369
                            value: topLevelSurfaceList.focusedWindow.state === Mir.FullscreenState
372
370
                        }
373
371
                    }
374
372
                    Label {
379
377
                Row {
380
378
                    CheckBox {
381
379
                        id: chromeAppCheck
 
380
                        activeFocusOnPress: false
 
381
                        activeFocusOnTab: false
382
382
 
383
383
                        onTriggered: {
384
384
                            if (!topLevelSurfaceList.focusedWindow || !topLevelSurfaceList.focusedWindow.surface) return;
394
394
                            target: chromeAppCheck
395
395
                            when: topLevelSurfaceList && topLevelSurfaceList.focusedWindow !== null && topLevelSurfaceList.focusedWindow.surface !== null
396
396
                            property: "checked"
397
 
                            value: {
398
 
                                if (!topLevelSurfaceList || !topLevelSurfaceList.focusedWindow || !topLevelSurfaceList.focusedWindow.surface) return false;
399
 
                                topLevelSurfaceList.focusedWindow.surface.shellChrome === Mir.LowChrome
400
 
                            }
 
397
                            value: topLevelSurfaceList.focusedWindow.surface &&
 
398
                                   topLevelSurfaceList.focusedWindow.surface.shellChrome === Mir.LowChrome
401
399
                        }
402
400
                    }
403
401
                    Label {
2308
2306
            return [
2309
2307
                { tag: "phone" },
2310
2308
                { tag: "tablet" },
2311
 
                { tag: "desktop" },
2312
2309
            ]
2313
2310
        }
2314
2311
 
2688
2685
        }
2689
2686
 
2690
2687
        function test_cursorHidingWithFullscreenApp() {
2691
 
            loadShell("desktop");
2692
 
            shell.usageScenario = "desktop";
 
2688
            loadShell("phone");
 
2689
            shell.usageScenario = "phone";
2693
2690
            waitForRendering(shell);
2694
2691
            swipeAwayGreeter();
2695
2692
 
2751
2748
            GSettingsController.setEnableIndicatorMenu(true);
2752
2749
        }
2753
2750
 
2754
 
        function test_spreadDisabled_data() {
 
2751
        function test_spreadDisabled_WithSwipe_data() {
2755
2752
            return [
2756
2753
                { tag: "enabled", spreadEnabled: true },
2757
2754
                { tag: "disabled", spreadEnabled: false }
2758
2755
            ];
2759
2756
        }
2760
2757
 
2761
 
        function test_spreadDisabled(data) {
 
2758
        function test_spreadDisabled_WithSwipe(data) {
2762
2759
            loadShell("phone");
2763
2760
            swipeAwayGreeter();
2764
2761
            var stage = findChild(shell, "stage");
2767
2764
            // Try swiping
2768
2765
            touchFlick(shell, shell.width - 2, shell.height / 2, units.gu(1), shell.height / 2);
2769
2766
            tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2770
 
 
2771
 
            stage.closeSpread();
2772
 
            tryCompare(stage, "state", "staged");
 
2767
        }
 
2768
 
 
2769
        function test_spreadDisabled_WithEdgePush_data() {
 
2770
            return [
 
2771
                { tag: "enabled", spreadEnabled: true },
 
2772
                { tag: "disabled", spreadEnabled: false }
 
2773
            ];
 
2774
        }
 
2775
 
 
2776
        function test_spreadDisabled_WithEdgePush(data) {
 
2777
            loadShell("phone");
 
2778
            swipeAwayGreeter();
 
2779
            var stage = findChild(shell, "stage");
 
2780
            stage.spreadEnabled = data.spreadEnabled;
2773
2781
 
2774
2782
            // Try by edge push
2775
2783
            var cursor = findChild(shell, "cursor");
2779
2787
            }
2780
2788
            mouseMove(stage, stage.width - units.gu(5), units.gu(10));
2781
2789
            tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2782
 
 
2783
 
            stage.closeSpread();
2784
 
            tryCompare(stage, "state", "staged");
 
2790
        }
 
2791
 
 
2792
        function test_spreadDisabled_WithAltTab_data() {
 
2793
            return [
 
2794
                { tag: "enabled", spreadEnabled: true },
 
2795
                { tag: "disabled", spreadEnabled: false }
 
2796
            ];
 
2797
        }
 
2798
 
 
2799
        function test_spreadDisabled_WithAltTab(data) {
 
2800
            loadShell("phone");
 
2801
            swipeAwayGreeter();
 
2802
            var stage = findChild(shell, "stage");
 
2803
            stage.spreadEnabled = data.spreadEnabled;
2785
2804
 
2786
2805
            // Try by alt+tab
2787
2806
            keyPress(Qt.Key_Alt);
2788
2807
            keyClick(Qt.Key_Tab);
2789
2808
            tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2790
2809
            keyRelease(Qt.Key_Alt);
2791
 
 
2792
 
            stage.closeSpread();
2793
 
            tryCompare(stage, "state", "staged");
 
2810
        }
 
2811
 
 
2812
        function test_spreadDisabled_WithSuperW_data() {
 
2813
            return [
 
2814
                { tag: "enabled", spreadEnabled: true },
 
2815
                { tag: "disabled", spreadEnabled: false }
 
2816
            ];
 
2817
        }
 
2818
 
 
2819
        function test_spreadDisabled_WithSuperW(data) {
 
2820
            loadShell("phone");
 
2821
            swipeAwayGreeter();
 
2822
            var stage = findChild(shell, "stage");
 
2823
            stage.spreadEnabled = data.spreadEnabled;
2794
2824
 
2795
2825
            // Try by Super+W
2796
 
            keyPress(Qt.Key_W, Qt.MetaModifier)
 
2826
            keyPress(Qt.Key_W, Qt.MetaModifier, 200);
2797
2827
            tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2798
2828
            keyRelease(Qt.Key_W, Qt.MetaModifier)
2799
2829
        }
2924
2954
            tryCompare(topLevelSurfaceList.focusedWindow, "surface", appDelegate.surface);
2925
2955
            tryCompare(topLevelSurfaceList.applicationAt(0), "appId", "dialer-app");
2926
2956
        }
 
2957
 
 
2958
        function test_doubleClickPanelRestoresWindow() {
 
2959
            loadShell("desktop");
 
2960
            shell.usageScenario = "desktop";
 
2961
            waitForRendering(shell);
 
2962
            swipeAwayGreeter();
 
2963
 
 
2964
            // start dialer
 
2965
            var appDelegate = startApplication("dialer-app")
 
2966
            verify(appDelegate);
 
2967
            tryCompare(appDelegate, "state", "normal");
 
2968
 
 
2969
            // maximize dialer
 
2970
            var decoration = findChild(appDelegate, "appWindowDecoration");
 
2971
            verify(decoration);
 
2972
            mouseDoubleClickSequence(decoration);
 
2973
            tryCompare(appDelegate, "state", "maximized");
 
2974
 
 
2975
            // double click the panel
 
2976
            var panel = findChild(shell, "panel");
 
2977
            verify(panel);
 
2978
            mouseDoubleClickSequence(panel, panel.width/2, PanelState.panelHeight/2, Qt.LeftButton, Qt.NoModifier, 300);
 
2979
            tryCompare(appDelegate, "state", "restored");
 
2980
        }
2927
2981
    }
2928
2982
}