@@ -605,38 +605,6 @@ Rectangle {
605605 compare(ApplicationManager.get(0).appId, "unity8-dash");
606606 }
607607
608− function test_phoneLeftEdgeDrag_data() {
609− return [
610− {tag: "without launcher",
611− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
612− launcherHides: true, greeterShown: false},
613−
614− {tag: "with launcher",
615− revealLauncher: true, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
616− launcherHides: true, greeterShown: false},
617−
618− {tag: "small swipe",
619− revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
620− launcherHides: false, greeterShown: false},
621−
622− {tag: "long swipe",
623− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
624− launcherHides: true, greeterShown: false},
625−
626− {tag: "small swipe with greeter",
627− revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
628− launcherHides: false, greeterShown: true},
629−
630− {tag: "long swipe with greeter",
631− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
632− launcherHides: true, greeterShown: true},
633−
634− {tag: "swipe over dash",
635− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "unity8-dash",
636− launcherHides: false, greeterShown: false},
637− ];
638− }
639−
640608 function test_snapDecisionDismissalReturnsFocus() {
641609 loadShell("phone");
642610 swipeAwayGreeter();
@@ -701,80 +669,6 @@ Rectangle {
701669 mockNotificationsModel.append(n)
702670 }
703671
704− function test_phoneLeftEdgeDrag(data) {
705− loadShell("phone");
706− swipeAwayGreeter();
707− dragLauncherIntoView();
708− var appSurfaceId = topLevelSurfaceList.nextId;
709− tapOnAppIconInLauncher();
710− waitUntilAppWindowIsFullyLoaded(appSurfaceId);
711−
712− var greeter = findChild(shell, "greeter");
713− if (data.greeterShown) {
714− showGreeter();
715− }
716−
717− if (data.revealLauncher) {
718− dragLauncherIntoView();
719− }
720−
721− swipeFromLeftEdge(data.swipeLength);
722− if (data.appHides) {
723− waitUntilDashIsFocused();
724− tryCompare(greeter, "shown", false);
725− } else {
726− tryCompare(greeter, "fullyShown", data.greeterShown);
727− }
728−
729− var launcher = findChild(shell, "launcherPanel");
730− tryCompare(launcher, "x", data.launcherHides ? -launcher.width : 0)
731−
732− //FIXME: This check fails. Don't understand the rationale behind it.
733− /*
734− // Make sure the helper for sliding out the launcher wasn't touched. We want to fade it out here.
735− var animateTimer = findInvisibleChild(shell, "animateTimer");
736− compare(animateTimer.nextState, "visible");
737− */
738− }
739−
740− function test_tabletLeftEdgeDrag_data() {
741− return [
742− {tag: "without password", user: "no-password", loggedIn: true},
743− {tag: "with password", user: "has-password", loggedIn: false},
744− ]
745− }
746−
747− function test_tabletLeftEdgeDrag(data) {
748− setLightDMMockMode("full");
749− loadShell("tablet");
750−
751− selectUser(data.user)
752−
753− swipeFromLeftEdge(shell.width * 0.75)
754− wait(500) // to give time to handle dash() signal from Launcher
755− confirmLoggedIn(data.loggedIn)
756− }
757−
758− function test_longLeftEdgeSwipeTakesToAppsAndResetSearchString() {
759− loadShell("phone");
760− swipeAwayGreeter();
761− dragLauncherIntoView();
762− dashCommunicatorSpy.clear();
763−
764− var appSurfaceId = topLevelSurfaceList.nextId;
765− tapOnAppIconInLauncher();
766− waitUntilAppWindowIsFullyLoaded(appSurfaceId);
767−
768− tryCompareFunction(function() { return ApplicationManager.focusedApplicationId !== "unity8-dash"; }, true);
769−
770− //Long left swipe
771− swipeFromLeftEdge(units.gu(30));
772−
773− tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
774−
775− compare(dashCommunicatorSpy.count, 1);
776− }
777−
778672 function test_ClickUbuntuIconInLauncherTakesToAppsAndResetSearchString() {
779673 loadShell("phone");
780674 swipeAwayGreeter();
@@ -913,39 +807,6 @@ Rectangle {
913807 LightDM.Users.mockMode = mode;
914808 }
915809
916− /*
917− Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
918−
919− When the user minimizes an application (left-edge swipe) he should always end up in the
920− "Applications" scope view.
921−
922− Steps:
923− - reveal launcher and launch an app that covers the dash
924− - perform long left edge swipe to go minimize the app and go back to the dash.
925− - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
926− */
927− function test_minimizingAppTakesToDashApps() {
928− loadShell("phone");
929− swipeAwayGreeter();
930− dragLauncherIntoView();
931−
932− // Launch an app from the launcher
933− var appSurfaceId = topLevelSurfaceList.nextId;
934− tapOnAppIconInLauncher();
935− waitUntilAppWindowIsFullyLoaded(appSurfaceId);
936−
937− verify(ApplicationManager.focusedApplicationId !== "unity8-dash")
938−
939− dashCommunicatorSpy.clear();
940− // Minimize the application we just launched
941− swipeFromLeftEdge(shell.width * 0.75);
942−
943− tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
944−
945− compare(dashCommunicatorSpy.count, 1);
946− compare(dashCommunicatorSpy.signalArguments[0][0], 0);
947− }
948−
949810 function test_showInputMethod() {
950811 loadShell("phone");
951812 swipeAwayGreeter();
@@ -1166,7 +1027,7 @@ Rectangle {
11661027
11671028 // Place the mouse against the window/screen edge and push beyond the barrier threshold
11681029 mouseMove(shell, 0, shell.height / 2);
1169− launcher.pushEdge(EdgeBarrierSettings.pushThreshold * 1.1);
1030+ launcher.pushEdge(EdgeBarrierSettings.pushThreshold * .8);
11701031
11711032 var panel = findChild(launcher, "launcherPanel");
11721033 verify(panel);
@@ -1186,9 +1047,7 @@ Rectangle {
11861047 waitUntilAppWindowIsFullyLoaded(appSurfaceId);
11871048
11881049 // Minimize the application we just launched
1189− swipeFromLeftEdge(shell.width * 0.75);
1190−
1191− waitUntilDashIsFocused();
1050+ swipeFromLeftEdge(units.gu(15));
11921051
11931052 showGreeter();
11941053
@@ -2779,5 +2638,69 @@ Rectangle {
27792638
27802639 GSettingsController.setEnableLauncher(true);
27812640 }
2641+
2642+ function test_indicatorMenuEnabledSetting_data() {
2643+ return [
2644+ {tag: "indicator menu enabled", enabled: true},
2645+ {tag: "indicator menu disabled", enabled: false}
2646+ ]
2647+ }
2648+
2649+ function test_indicatorMenuEnabledSetting(data) {
2650+ loadShell("phone");
2651+
2652+ GSettingsController.setEnableIndicatorMenu(data.enabled);
2653+
2654+ var panel = findChild(shell, "panel");
2655+ compare(panel.indicators.available, data.enabled);
2656+
2657+ GSettingsController.setEnableIndicatorMenu(true);
2658+ }
2659+
2660+ function test_spreadDisabled_data() {
2661+ return [
2662+ { tag: "enabled", spreadEnabled: true },
2663+ { tag: "disabled", spreadEnabled: false }
2664+ ];
2665+ }
2666+
2667+ function test_spreadDisabled(data) {
2668+ loadShell("phone");
2669+ swipeAwayGreeter();
2670+ var stage = findChild(shell, "stage");
2671+ stage.spreadEnabled = data.spreadEnabled;
2672+
2673+ // Try swiping
2674+ touchFlick(shell, shell.width - 2, shell.height / 2, units.gu(1), shell.height / 2);
2675+ tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2676+
2677+ stage.closeSpread();
2678+ tryCompare(stage, "state", "staged");
2679+
2680+ // Try by edge push
2681+ mouseMove(stage, stage.width - 1, units.gu(10));
2682+ for (var i = 0; i < units.gu(10); i++) {
2683+ stage.pushRightEdge(1);
2684+ }
2685+ mouseMove(stage, stage.width - units.gu(5), units.gu(10));
2686+ tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2687+
2688+ stage.closeSpread();
2689+ tryCompare(stage, "state", "staged");
2690+
2691+ // Try by alt+tab
2692+ keyPress(Qt.Key_Alt);
2693+ keyClick(Qt.Key_Tab);
2694+ tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2695+ keyRelease(Qt.Key_Alt);
2696+
2697+ stage.closeSpread();
2698+ tryCompare(stage, "state", "staged");
2699+
2700+ // Try by Super+W
2701+ keyPress(Qt.Key_W, Qt.MetaModifier)
2702+ tryCompare(stage, "state", data.spreadEnabled ? "spread" : "staged");
2703+ keyRelease(Qt.Key_W, Qt.MetaModifier)
2704+ }
27822705 }
27832706}