@@ -22,6 +22,7 @@ import Ubuntu.Components.ListItems 1.0 as ListItem
22import Unity.Application 0.1
22import Unity.Application 0.1
23import Unity.Test 0.1
23import Unity.Test 0.1
24import LightDM 0.1 as LightDM
24import LightDM 0.1 as LightDM
26import "../../qml"
27import "../../qml"
@@ -161,8 +162,16 @@ Rectangle {
163 Rectangle {
164 Rectangle {
164− id: controls
165+ width: controls.width
168+ bottom: parent.bottom
165 color: "darkgrey"
171 color: "darkgrey"
166 width: units.gu(30)
175 width: units.gu(30)
167 anchors {
176 anchors {
168 top: parent.top
177 top: parent.top
@@ -170,7 +179,11 @@ Rectangle {
170 right: parent.right
179 right: parent.right
182+ boundsBehavior: Flickable.StopAtBounds
183+ contentHeight: controlsColumn.height
174 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
187 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
175 spacing: units.gu(1)
188 spacing: units.gu(1)
@@ -281,6 +294,17 @@ Rectangle {
281 anchors.verticalCenter: parent.verticalCenter
294 anchors.verticalCenter: parent.verticalCenter
298+ text: Powerd.status === Powerd.On ? "Display ON" : "Display OFF"
299+ activeFocusOnPress: false
301+ if (Powerd.status === Powerd.On) {
302+ Powerd.status = Powerd.Off;
304+ Powerd.status = Powerd.On;
@@ -947,16 +971,31 @@ Rectangle {
947 // If we swipe too much we will trigger the spread mode
971 // If we swipe too much we will trigger the spread mode
948 // and we don't want that.
972 // and we don't want that.
949 var spreadView = findChild(shell, "spreadView");
973 var spreadView = findChild(shell, "spreadView");
950− var swipeLength = (spreadView.positionMarker1 * spreadView.width) * 0.5;
974+ verify(spreadView);
952 verify(ApplicationManager.count >= 2);
976 verify(ApplicationManager.count >= 2);
953 var previousApp = ApplicationManager.get(1);
977 var previousApp = ApplicationManager.get(1);
955 var touchStartX = shell.width - 1;
979 var touchStartX = shell.width - 1;
956 var touchStartY = shell.height / 2;
980 var touchStartY = shell.height / 2;
957− touchFlick(shell,
981+
983+ if (applicationArguments.deviceName === "phone") {
984+ condition = function() {
985+ return spreadView.shiftedContentX > units.gu(2) &&
986+ spreadView.shiftedContentX < spreadView.positionMarker1 * spreadView.width;
989+ condition = function() {
990+ return spreadView.shiftedContentX > spreadView.width * spreadView.positionMarker1
991+ && spreadView.shiftedContentX < spreadView.width * spreadView.positionMarker2;
995+ touchDragUntil(shell,
958− touchStartX, touchStartY,
996+ touchStartX, touchStartY,
959− touchStartX - swipeLength, touchStartY);
997+ -units.gu(1), 0,
961 // ensure the app switch animation has ended
1000 // ensure the app switch animation has ended
962 tryCompare(spreadView, "shiftedContentX", 0);
1001 tryCompare(spreadView, "shiftedContentX", 0);
@@ -1039,6 +1078,8 @@ Rectangle {
1040 waitUntilShellIsInOrientation(root.physicalOrientation0);
1079 waitUntilShellIsInOrientation(root.physicalOrientation0);
1081+ waitForGreeterToStabilize();
1042 swipeAwayGreeter();
1083 swipeAwayGreeter();
1044 var spreadRepeater = findChild(shell, "spreadRepeater");
1085 var spreadRepeater = findChild(shell, "spreadRepeater");
@@ -1047,6 +1088,19 @@ Rectangle {
1091+ function waitForGreeterToStabilize() {
1092+ var greeter = findChild(shell, "greeter");
1095+ var loginList = findChild(greeter, "loginList");
1096+ // Only present in WideView
1098+ var userList = findChild(loginList, "userList");
1100+ tryCompare(userList, "movingInternally", false);
1050 // expectedAngle is in orientedShell's coordinate system
1104 // expectedAngle is in orientedShell's coordinate system
1051 function checkAppSurfaceOrientation(app, expectedAngle) {
1105 function checkAppSurfaceOrientation(app, expectedAngle) {
1052 var surface = app.session.surface;
1106 var surface = app.session.surface;