on xenial help sign in
improve test a bit
bc65500Michael Zanetti
tests/qmltests/Stages/tst_PhoneStage.qml+8−11
@@ -245,20 +245,17 @@ Item {
245 }
245 }
246
246
247 function test_fullscreenMode() {
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;
248 var fullscreenApp = null;
254 var normalApp = null;
249 var normalApp = null;
255
250
256− for (var i = 0; i < ApplicationManager.count; i++) {
251+ for (var i = 0; i < 5; i++) {
252+ addApps(1);
257− if (ApplicationManager.get(i).fullscreen && fullscreenApp == null) {
253+ var newApp = ApplicationManager.get(0);
254+ tryCompare(phoneStage, "fullscreen", newApp.fullscreen);
255+ if (newApp.fullscreen && fullscreenApp == null) {
258− fullscreenApp = ApplicationManager.get(i);
256+ fullscreenApp = newApp;
259− }
260− if (!ApplicationManager.get(i).fullscreen && normalApp == null) {
257+ } else if (!newApp.fullscreen && normalApp == null){
261− normalApp = ApplicationManager.get(i);
258+ normalApp = newApp;
262 }
259 }
263 }
260 }
264 verify(fullscreenApp != null); // Can't continue the test without having a fullscreen app
261 verify(fullscreenApp != null); // Can't continue the test without having a fullscreen app