~mzanetti/unity8/modeswitchwarning

« back to all changes in this revision

Viewing changes to tests/qmltests/tst_Shell.qml

  • Committer: Michael Zanetti
  • Date: 2015-11-05 12:05:27 UTC
  • mfrom: (1978.20.8 no-touch-no-lifecycle)
  • Revision ID: michael.zanetti@canonical.com-20151105120527-yxb2mx4b3g9tyrka
merge prereq

Show diffs side-by-side

added added

removed removed

Lines of Context:
392
392
            compare(ApplicationManager.count, 1)
393
393
        }
394
394
 
395
 
        function atest_snapDecisionDismissalReturnsFocus() {
 
395
        function test_snapDecisionDismissalReturnsFocus() {
396
396
            loadShell("phone");
397
397
            swipeAwayGreeter();
398
398
            var notifications = findChild(shell, "notificationList");
453
453
            mockNotificationsModel.append(n)
454
454
        }
455
455
 
456
 
        function atest_phoneLeftEdgeDrag_data() {
 
456
        function test_phoneLeftEdgeDrag_data() {
457
457
            return [
458
458
                {tag: "without launcher",
459
459
                 revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
485
485
            ];
486
486
        }
487
487
 
488
 
        function atest_phoneLeftEdgeDrag(data) {
 
488
        function test_phoneLeftEdgeDrag(data) {
489
489
            loadShell("phone");
490
490
            swipeAwayGreeter();
491
491
            dragLauncherIntoView();
520
520
            compare(animateTimer.nextState, "visible");
521
521
        }
522
522
 
523
 
        function atest_tabletLeftEdgeDrag_data() {
 
523
        function test_tabletLeftEdgeDrag_data() {
524
524
            return [
525
525
                {tag: "without password", user: "no-password", loggedIn: true, demo: false},
526
526
                {tag: "with password", user: "has-password", loggedIn: false, demo: false},
528
528
            ]
529
529
        }
530
530
 
531
 
        function atest_tabletLeftEdgeDrag(data) {
 
531
        function test_tabletLeftEdgeDrag(data) {
532
532
            setLightDMMockMode("full");
533
533
            loadShell("tablet");
534
534
 
543
543
            confirmLoggedIn(data.loggedIn)
544
544
        }
545
545
 
546
 
        function atest_longLeftEdgeSwipeTakesToAppsAndResetSearchString() {
 
546
        function test_longLeftEdgeSwipeTakesToAppsAndResetSearchString() {
547
547
            loadShell("phone");
548
548
            swipeAwayGreeter();
549
549
            dragLauncherIntoView();
562
562
            compare(dashCommunicatorSpy.count, 1);
563
563
        }
564
564
 
565
 
        function atest_ClickUbuntuIconInLauncherTakesToAppsAndResetSearchString() {
 
565
        function test_ClickUbuntuIconInLauncherTakesToAppsAndResetSearchString() {
566
566
            loadShell("phone");
567
567
            swipeAwayGreeter();
568
568
            dragLauncherIntoView();
578
578
            compare(dashCommunicatorSpy.count, 1);
579
579
        }
580
580
 
581
 
        function atest_suspend() {
 
581
        function test_suspend() {
582
582
            loadShell("phone");
583
583
            swipeAwayGreeter();
584
584
            var greeter = findChild(shell, "greeter");
704
704
          - perform long left edge swipe to go minimize the app and go back to the dash.
705
705
          - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
706
706
         */
707
 
        function atest_minimizingAppTakesToDashApps() {
 
707
        function test_minimizingAppTakesToDashApps() {
708
708
            loadShell("phone");
709
709
            swipeAwayGreeter();
710
710
            dragLauncherIntoView();
726
726
            compare(dashCommunicatorSpy.signalArguments[0][0], 0);
727
727
        }
728
728
 
729
 
        function atest_showInputMethod() {
 
729
        function test_showInputMethod() {
730
730
            loadShell("phone");
731
731
            swipeAwayGreeter();
732
732
            var item = findChild(shell, "inputMethod");
757
757
            waitUntilTransitionsEnd(appWindowStateGroup);
758
758
        }
759
759
 
760
 
        function atest_surfaceLosesActiveFocusWhilePanelIsOpen() {
 
760
        function test_surfaceLosesActiveFocusWhilePanelIsOpen() {
761
761
            loadShell("phone");
762
762
            swipeAwayGreeter();
763
763
            var app = ApplicationManager.startApplication("dialer-app");
790
790
            tryCompare(app.session.surface, "activeFocus", true);
791
791
        }
792
792
 
793
 
        function atest_launchedAppHasActiveFocus_data() {
 
793
        function test_launchedAppHasActiveFocus_data() {
794
794
            return [
795
795
                {tag: "phone", formFactor: "phone", usageScenario: "phone"},
796
796
                {tag: "tablet", formFactor: "tablet", usageScenario: "tablet"},
798
798
            ]
799
799
        }
800
800
 
801
 
        function atest_launchedAppHasActiveFocus(data) {
 
801
        function test_launchedAppHasActiveFocus(data) {
802
802
            loadShell(data.formFactor);
803
803
            shell.usageScenario = data.usageScenario;
804
804
            waitForGreeterToStabilize();
813
813
            tryCompare(webApp.session.surface, "activeFocus", true);
814
814
        }
815
815
 
816
 
        function atest_launchedAppKeepsActiveFocusOnUsageModeChange() {
 
816
        function test_launchedAppKeepsActiveFocusOnUsageModeChange() {
817
817
            loadShell("tablet");
818
818
            swipeAwayGreeter();
819
819
 
941
941
            removeTimeConstraintsFromDirectionalDragAreas(greeter);
942
942
        }
943
943
 
944
 
        function atest_focusRequestedHidesGreeter() {
 
944
        function test_focusRequestedHidesGreeter() {
945
945
            loadShell("phone");
946
946
            swipeAwayGreeter();
947
947
            var greeter = findChild(shell, "greeter");
963
963
            waitForRendering(greeter);
964
964
        }
965
965
 
966
 
        function atest_focusRequestedHidesIndicators() {
 
966
        function test_focusRequestedHidesIndicators() {
967
967
            loadShell("phone");
968
968
            swipeAwayGreeter();
969
969
            var indicators = findChild(shell, "indicators");
977
977
            tryCompare(indicators, "fullyClosed", true);
978
978
        }
979
979
 
980
 
        function atest_showAndHideGreeterDBusCalls() {
 
980
        function test_showAndHideGreeterDBusCalls() {
981
981
            loadShell("phone");
982
982
            swipeAwayGreeter();
983
983
            var greeter = findChild(shell, "greeter")
990
990
            tryCompare(greeter, "shown", false)
991
991
        }
992
992
 
993
 
        function atest_greeterLoginsAutomaticallyWhenNoPasswordSet() {
 
993
        function test_greeterLoginsAutomaticallyWhenNoPasswordSet() {
994
994
            loadShell("phone");
995
995
            swipeAwayGreeter();
996
996
 
1002
1002
            tryCompare(sessionSpy, "count", 1);
1003
1003
        }
1004
1004
 
1005
 
        function atest_fullscreen() {
 
1005
        function test_fullscreen() {
1006
1006
            loadShell("phone");
1007
1007
            swipeAwayGreeter();
1008
1008
            var panel = findChild(shell, "panel");
1017
1017
            tryCompare(panel, "fullscreenMode", false);
1018
1018
        }
1019
1019
 
1020
 
        function atest_leftEdgeDragFullscreen() {
 
1020
        function test_leftEdgeDragFullscreen() {
1021
1021
            loadShell("phone");
1022
1022
            swipeAwayGreeter();
1023
1023
            var panel = findChild(shell, "panel");
1040
1040
            touchRelease(shell);
1041
1041
        }
1042
1042
 
1043
 
        function atest_unlockedProperties() {
 
1043
        function test_unlockedProperties() {
1044
1044
            loadShell("phone");
1045
1045
            swipeAwayGreeter();
1046
1046
            // Confirm that various properties have the correct values when unlocked
1054
1054
            tryCompare(indicators, "available", true)
1055
1055
        }
1056
1056
 
1057
 
        function atest_unlockAllModemsOnBoot() {
 
1057
        function test_unlockAllModemsOnBoot() {
1058
1058
            loadShell("phone");
1059
1059
            swipeAwayGreeter();
1060
1060
            tryCompare(unlockAllModemsSpy, "count", 1)
1061
1061
        }
1062
1062
 
1063
 
        function atest_unlockAllModemsAfterWizard() {
 
1063
        function test_unlockAllModemsAfterWizard() {
1064
1064
            Wizard.System.wizardEnabled = true;
1065
1065
            loadShell("phone");
1066
1066
 
1075
1075
            compare(unlockAllModemsSpy.count, 1);
1076
1076
        }
1077
1077
 
1078
 
        function atest_wizardEarlyExit() {
 
1078
        function test_wizardEarlyExit() {
1079
1079
            Wizard.System.wizardEnabled = true;
1080
1080
            AccountsService.demoEdges = true;
1081
1081
            loadShell("phone");
1111
1111
            compare(tutorialLeft, null); // should be destroyed with tutorial
1112
1112
        }
1113
1113
 
1114
 
        function atest_tutorialPausedDuringGreeter() {
 
1114
        function test_tutorialPausedDuringGreeter() {
1115
1115
            loadShell("phone");
1116
1116
 
1117
1117
            var tutorial = findChild(shell, "tutorial");
1124
1124
            tryCompare(tutorial, "paused", false);
1125
1125
        }
1126
1126
 
1127
 
        function atest_tapOnRightEdgeReachesApplicationSurface() {
 
1127
        function test_tapOnRightEdgeReachesApplicationSurface() {
1128
1128
            loadShell("phone");
1129
1129
            swipeAwayGreeter();
1130
1130
            var topmostSpreadDelegate = findChild(shell, "appDelegate0");
1153
1153
            that no touch event was sent to it (ie, they were all consumed
1154
1154
            by the right-edge drag area)
1155
1155
         */
1156
 
        function atest_rightEdgeDragDoesNotReachApplicationSurface() {
 
1156
        function test_rightEdgeDragDoesNotReachApplicationSurface() {
1157
1157
            loadShell("phone");
1158
1158
            swipeAwayGreeter();
1159
1159
            var topmostSpreadDelegate = findChild(shell, "appDelegate0");
1199
1199
            tryCompare(spreadView, "phase", 2);
1200
1200
        }
1201
1201
 
1202
 
        function atest_tapUbuntuIconInLauncherOverAppSpread() {
 
1202
        function test_tapUbuntuIconInLauncherOverAppSpread() {
1203
1203
            launcherShowDashHomeSpy.clear();
1204
1204
 
1205
1205
            loadShell("phone");
1245
1245
            tryCompare(launcherPanel, "x", -launcherPanel.width);
1246
1246
        }
1247
1247
 
1248
 
        function atest_tabletLogin_data() {
 
1248
        function test_tabletLogin_data() {
1249
1249
            return [
1250
1250
                {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},
1251
1251
                {tag: "with password", user: "has-password", loggedIn: true, password: "password"},
1253
1253
            ]
1254
1254
        }
1255
1255
 
1256
 
        function atest_tabletLogin(data) {
 
1256
        function test_tabletLogin(data) {
1257
1257
            setLightDMMockMode("full");
1258
1258
            loadShell("tablet");
1259
1259
 
1269
1269
            confirmLoggedIn(data.loggedIn);
1270
1270
        }
1271
1271
 
1272
 
        function atest_appLaunchDuringGreeter_data() {
 
1272
        function test_appLaunchDuringGreeter_data() {
1273
1273
            return [
1274
1274
                {tag: "auth error", user: "auth-error", loggedIn: false, passwordFocus: false},
1275
1275
                {tag: "without password", user: "no-password", loggedIn: true, passwordFocus: false},
1277
1277
            ]
1278
1278
        }
1279
1279
 
1280
 
        function atest_appLaunchDuringGreeter(data) {
 
1280
        function test_appLaunchDuringGreeter(data) {
1281
1281
            setLightDMMockMode("full");
1282
1282
            loadShell("tablet");
1283
1283
 
1294
1294
            }
1295
1295
        }
1296
1296
 
1297
 
        function atest_stageLoader_data() {
 
1297
        function test_stageLoader_data() {
1298
1298
            return [
1299
1299
                {tag: "phone", source: "Stages/PhoneStage.qml", formFactor: "phone", usageScenario: "phone"},
1300
1300
                {tag: "tablet", source: "Stages/TabletStage.qml", formFactor: "tablet", usageScenario: "tablet"},
1302
1302
            ]
1303
1303
        }
1304
1304
 
1305
 
        function atest_stageLoader(data) {
 
1305
        function test_stageLoader(data) {
1306
1306
            loadShell(data.formFactor);
1307
1307
            shell.usageScenario = data.usageScenario;
1308
1308
            var stageLoader = findChild(shell, "applicationsDisplayLoader");
1309
1309
            verify(String(stageLoader.source).indexOf(data.source) >= 0);
1310
1310
        }
1311
1311
 
1312
 
        function atest_launcherInverted_data() {
 
1312
        function test_launcherInverted_data() {
1313
1313
            return [
1314
1314
                {tag: "phone", formFactor: "phone", usageScenario: "phone", launcherInverted: true},
1315
1315
                {tag: "tablet", formFactor: "tablet", usageScenario: "tablet", launcherInverted: true},
1317
1317
            ]
1318
1318
        }
1319
1319
 
1320
 
        function atest_launcherInverted(data) {
 
1320
        function test_launcherInverted(data) {
1321
1321
            loadShell(data.formFactor);
1322
1322
            shell.usageScenario = data.usageScenario;
1323
1323
 
1325
1325
            compare(launcher.inverted, data.launcherInverted);
1326
1326
        }
1327
1327
 
1328
 
        function atest_unfocusedAppsGetSuspendedAfterEnteringStagedMode() {
 
1328
        function test_unfocusedAppsGetSuspendedAfterEnteringStagedMode() {
1329
1329
            loadShell("tablet");
1330
1330
            shell.usageScenario = "desktop";
1331
1331
 
1347
1347
            tryCompare(galleryApp, "requestedState", ApplicationInfoInterface.RequestedSuspended);
1348
1348
        }
1349
1349
 
1350
 
        function atest_unfocusedAppsAreResumedWhenEnteringWindowedMode() {
 
1350
        function test_unfocusedAppsAreResumedWhenEnteringWindowedMode() {
1351
1351
            loadShell("tablet");
1352
1352
            shell.usageScenario = "tablet";
1353
1353
 
1369
1369
            tryCompare(galleryApp, "requestedState", ApplicationInfoInterface.RequestedRunning);
1370
1370
        }
1371
1371
 
1372
 
        function atest_altTabSwitchesFocus() {
 
1372
        function test_altTabSwitchesFocus() {
1373
1373
            loadShell("desktop");
1374
1374
            shell.usageScenario = "desktop"
1375
1375
            waitForRendering(root)
1406
1406
            tryCompare(app3.session.surface, "activeFocus", true)
1407
1407
        }
1408
1408
 
1409
 
        function atest_altTabWrapAround() {
 
1409
        function test_altTabWrapAround() {
1410
1410
            loadDesktopShellWithApps();
1411
1411
 
1412
1412
            var desktopStage = findChild(shell, "stage");
1455
1455
            tryCompare(focused.session.surface, "activeFocus", true)
1456
1456
        }
1457
1457
 
1458
 
        function atest_altBackTabNavigation() {
 
1458
        function test_altBackTabNavigation() {
1459
1459
            loadDesktopShellWithApps();
1460
1460
 
1461
1461
            var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1486
1486
            keyRelease(Qt.Key_Control);
1487
1487
        }
1488
1488
 
1489
 
        function atest_highlightFollowsMouse() {
 
1489
        function test_highlightFollowsMouse() {
1490
1490
            loadDesktopShellWithApps()
1491
1491
 
1492
1492
            var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1514
1514
            keyRelease(Qt.Key_Control);
1515
1515
        }
1516
1516
 
1517
 
        function atest_closeFromSpread() {
 
1517
        function test_closeFromSpread() {
1518
1518
            loadDesktopShellWithApps()
1519
1519
 
1520
1520
            var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1550
1550
            keyRelease(Qt.Key_Control);
1551
1551
        }
1552
1552
 
1553
 
        function atest_selectFromSpreadWithMouse_data() {
 
1553
        function test_selectFromSpreadWithMouse_data() {
1554
1554
            return [
1555
1555
                {tag: "click on tileInfo", tileInfo: true },
1556
1556
                {tag: "click on surface", tileInfo: false },
1557
1557
            ]
1558
1558
        }
1559
1559
 
1560
 
        function atest_selectFromSpreadWithMouse(data) {
 
1560
        function test_selectFromSpreadWithMouse(data) {
1561
1561
            loadDesktopShellWithApps()
1562
1562
 
1563
1563
            var stage = findChild(shell, "stage");
1597
1597
            keyRelease(Qt.Key_Control);
1598
1598
        }
1599
1599
 
1600
 
        function atest_progressiveAutoScrolling() {
 
1600
        function test_progressiveAutoScrolling() {
1601
1601
            loadDesktopShellWithApps()
1602
1602
 
1603
1603
            var appRepeater = findInvisibleChild(shell, "appRepeater");
1634
1634
 
1635
1635
        // This makes sure the hoverMouseArea is set to invisible AND disabled
1636
1636
        // when not needed. Otherwise it'll eat mouse hover events for the rest of the shell/apps
1637
 
        function atest_hoverMouseAreaDisabledAndInvisible() {
 
1637
        function test_hoverMouseAreaDisabledAndInvisible() {
1638
1638
            loadDesktopShellWithApps()
1639
1639
 
1640
1640
            var hoverMouseArea = findChild(shell, "hoverMouseArea");
1653
1653
            tryCompare(hoverMouseArea, "visible", false)
1654
1654
        }
1655
1655
 
1656
 
        function atest_workspacePreviewsHighlightedApp() {
 
1656
        function test_workspacePreviewsHighlightedApp() {
1657
1657
            loadDesktopShellWithApps()
1658
1658
 
1659
1659
            var targetZ = ApplicationManager.count + 1;
1688
1688
            keyRelease(Qt.Key_Control);
1689
1689
        }
1690
1690
 
1691
 
        function atest_focusAppFromLauncherExitsSpread() {
 
1691
        function test_focusAppFromLauncherExitsSpread() {
1692
1692
            loadDesktopShellWithApps()
1693
1693
 
1694
1694
            var desktopSpread = findChild(shell, "spread");
1714
1714
        }
1715
1715
 
1716
1716
        // regression test for http://pad.lv/1443319
1717
 
        function atest_closeMaximizedAndRestart() {
 
1717
        function test_closeMaximizedAndRestart() {
1718
1718
            loadDesktopShellWithApps();
1719
1719
 
1720
1720
            var appRepeater = findChild(shell, "appRepeater")
1739
1739
        }
1740
1740
 
1741
1741
        // bug http://pad.lv/1431566
1742
 
        function atest_switchToStagedHidesPanelButtons() {
 
1742
        function test_switchToStagedHidesPanelButtons() {
1743
1743
            loadDesktopShellWithApps();
1744
1744
            var appRepeater = findChild(shell, "appRepeater")
1745
1745
            var appId = ApplicationManager.get(0).appId;
1761
1761
            tryCompare(panelButtons, "visible", true);
1762
1762
        }
1763
1763
 
1764
 
        function atest_lockingGreeterHidesPanelButtons() {
 
1764
        function test_lockingGreeterHidesPanelButtons() {
1765
1765
            loadDesktopShellWithApps();
1766
1766
            var appRepeater = findChild(shell, "appRepeater")
1767
1767
            var appId = ApplicationManager.get(0).appId;