@@ -83,6 +83,18 @@ Item {
86+ function goToSpread() {
87+ var spreadView = findChild(phoneStage, "spreadView");
89+ var startX = phoneStage.width;
90+ var startY = phoneStage.height / 2;
92+ var endX = units.gu(2);
94+ touchFlick(phoneStage, startX, startY, endX, endY,
95+ true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
86 function test_shortFlick() {
98 function test_shortFlick() {
87 addApps(2)
99 addApps(2)
88 var startX = phoneStage.width - units.gu(1);
100 var startX = phoneStage.width - units.gu(1);
@@ -175,13 +187,7 @@ Item {
176 var spreadView = findChild(phoneStage, "spreadView");
188 var spreadView = findChild(phoneStage, "spreadView");
178− var startX = phoneStage.width;
190+ goToSpread();
179− var startY = phoneStage.height / 2;
181− var endX = spreadView.width - (spreadView.width * spreadView.positionMarker3) - 1 - phoneStage.dragAreaWidth;
183− touchFlick(phoneStage, startX, startY, endX, endY,
184− true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
186 tryCompare(spreadView, "phase", 2);
192 tryCompare(spreadView, "phase", 2);
@@ -190,7 +196,11 @@ Item {
191 if (tile.mapToItem(spreadView).x > spreadView.width) {
197 if (tile.mapToItem(spreadView).x > spreadView.width) {
192 // Item is not visible... Need to flick the spread
198 // Item is not visible... Need to flick the spread
199+ var startX = phoneStage.width - units.gu(1);
200+ var startY = phoneStage.height / 2;
202+ var endX = units.gu(2);
193− touchFlick(phoneStage, startX - units.gu(1), startY, endX, endY, true, true, units.gu(10), 50)
203+ touchFlick(phoneStage, startX, startY, endX, endY, true, true, units.gu(10), 50)
194 tryCompare(spreadView, "flicking", false);
204 tryCompare(spreadView, "flicking", false);
195 tryCompare(spreadView, "moving", false);
205 tryCompare(spreadView, "moving", false);
196// waitForRendering(phoneStage);
206// waitForRendering(phoneStage);
@@ -224,16 +234,9 @@ Item {
224 addApps(5);
234 addApps(5);
226 var spreadView = findChild(phoneStage, "spreadView");
236 var spreadView = findChild(phoneStage, "spreadView");
228− var startX = phoneStage.width;
229− var startY = phoneStage.height / 2;
231− var endX = units.gu(2);
233 var selectedApp = ApplicationManager.get(data.index);
237 var selectedApp = ApplicationManager.get(data.index);
235− touchFlick(phoneStage, startX, startY, endX, endY,
239+ goToSpread();
236− true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
238 phoneStage.select(selectedApp.appId);
241 phoneStage.select(selectedApp.appId);
@@ -241,6 +244,42 @@ Item {
241 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
244 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
247+ function test_fullscreenMode() {
248+ for (var i = 0; i < 5; i++) {
250+ tryCompare(phoneStage, "fullscreen", ApplicationManager.get(0).fullscreen);
253+ var fullscreenApp = null;
254+ var normalApp = null;
256+ for (var i = 0; i < ApplicationManager.count; i++) {
257+ if (ApplicationManager.get(i).fullscreen && fullscreenApp == null) {
258+ fullscreenApp = ApplicationManager.get(i);
260+ if (!ApplicationManager.get(i).fullscreen && normalApp == null) {
261+ normalApp = ApplicationManager.get(i);
264+ verify(fullscreenApp != null); // Can't continue the test without having a fullscreen app
265+ verify(normalApp != null); // Can't continue the test without having a non-fullscreen app
267+ // Select a normal app
269+ phoneStage.select(normalApp.appId);
270+ tryCompare(phoneStage, "fullscreen", false);
272+ // Select a fullscreen app
274+ phoneStage.select(fullscreenApp.appId);
275+ tryCompare(phoneStage, "fullscreen", true);
277+ // Select a normal app
279+ phoneStage.select(normalApp.appId);
280+ tryCompare(phoneStage, "fullscreen", false);
244 function cleanup() {
283 function cleanup() {
245 while (ApplicationManager.count > 0) {
284 while (ApplicationManager.count > 0) {
246 var oldCount = ApplicationManager.count;
285 var oldCount = ApplicationManager.count;