@@ -245,20 +245,17 @@ Item {
245245 }
246246
247247 function test_fullscreenMode() {
248− for (var i = 0; i < 5; i++) {
249− addApps(1);
250− tryCompare(phoneStage, "fullscreen", ApplicationManager.get(0).fullscreen);
251− }
252−
253248 var fullscreenApp = null;
254249 var normalApp = null;
255250
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);
251+ for (var i = 0; i < 5; i++) {
252+ addApps(1);
253+ var newApp = ApplicationManager.get(0);
254+ tryCompare(phoneStage, "fullscreen", newApp.fullscreen);
255+ if (newApp.fullscreen && fullscreenApp == null) {
256+ fullscreenApp = newApp;
257+ } else if (!newApp.fullscreen && normalApp == null){
258+ normalApp = newApp;
262259 }
263260 }
264261 verify(fullscreenApp != null); // Can't continue the test without having a fullscreen app