@@ -83,6 +83,18 @@ Item {
8383 }
8484 }
8585
86+ function goToSpread() {
87+ var spreadView = findChild(phoneStage, "spreadView");
88+
89+ var startX = phoneStage.width;
90+ var startY = phoneStage.height / 2;
91+ var endY = startY;
92+ var endX = units.gu(2);
93+
94+ touchFlick(phoneStage, startX, startY, endX, endY,
95+ true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
96+ }
97+
8698 function test_shortFlick() {
8799 addApps(2)
88100 var startX = phoneStage.width - units.gu(1);
@@ -175,13 +187,7 @@ Item {
175187
176188 var spreadView = findChild(phoneStage, "spreadView");
177189
178− var startX = phoneStage.width;
179− var startY = phoneStage.height / 2;
180− var endY = startY;
181− var endX = spreadView.width - (spreadView.width * spreadView.positionMarker3) - 1 - phoneStage.dragAreaWidth;
182−
183− touchFlick(phoneStage, startX, startY, endX, endY,
184− true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
190+ goToSpread();
185191
186192 tryCompare(spreadView, "phase", 2);
187193
@@ -190,7 +196,11 @@ Item {
190196
191197 if (tile.mapToItem(spreadView).x > spreadView.width) {
192198 // Item is not visible... Need to flick the spread
193− touchFlick(phoneStage, startX - units.gu(1), startY, endX, endY, true, true, units.gu(10), 50)
199+ var startX = phoneStage.width - units.gu(1);
200+ var startY = phoneStage.height / 2;
201+ var endY = startY;
202+ var endX = units.gu(2);
203+ touchFlick(phoneStage, startX, startY, endX, endY, true, true, units.gu(10), 50)
194204 tryCompare(spreadView, "flicking", false);
195205 tryCompare(spreadView, "moving", false);
196206// waitForRendering(phoneStage);
@@ -224,16 +234,9 @@ Item {
224234 addApps(5);
225235
226236 var spreadView = findChild(phoneStage, "spreadView");
227−
228− var startX = phoneStage.width;
229− var startY = phoneStage.height / 2;
230− var endY = startY;
231− var endX = units.gu(2);
232−
233237 var selectedApp = ApplicationManager.get(data.index);
234238
235− touchFlick(phoneStage, startX, startY, endX, endY,
236− true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
239+ goToSpread();
237240
238241 phoneStage.select(selectedApp.appId);
239242
@@ -241,6 +244,42 @@ Item {
241244 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
242245 }
243246
247+ function test_fullscreenMode() {
248+ for (var i = 0; i < 5; i++) {
249+ addApps(1);
250+ tryCompare(phoneStage, "fullscreen", ApplicationManager.get(0).fullscreen);
251+ }
252+
253+ var fullscreenApp = null;
254+ var normalApp = null;
255+
256+ for (var i = 0; i < ApplicationManager.count; i++) {
257+ if (ApplicationManager.get(i).fullscreen && fullscreenApp == null) {
258+ fullscreenApp = ApplicationManager.get(i);
259+ }
260+ if (!ApplicationManager.get(i).fullscreen && normalApp == null) {
261+ normalApp = ApplicationManager.get(i);
262+ }
263+ }
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
266+
267+ // Select a normal app
268+ goToSpread();
269+ phoneStage.select(normalApp.appId);
270+ tryCompare(phoneStage, "fullscreen", false);
271+
272+ // Select a fullscreen app
273+ goToSpread();
274+ phoneStage.select(fullscreenApp.appId);
275+ tryCompare(phoneStage, "fullscreen", true);
276+
277+ // Select a normal app
278+ goToSpread();
279+ phoneStage.select(normalApp.appId);
280+ tryCompare(phoneStage, "fullscreen", false);
281+ }
282+
244283 function cleanup() {
245284 while (ApplicationManager.count > 0) {
246285 var oldCount = ApplicationManager.count;