on xenial help sign in
testLauncher: use tryCompare to check launcher contentY

Also init the launcher before each test

commite1b8fa8d0ee93ace8b1336ff534a81e8c8b2c8c7 authorMarco Trevisan (Treviño) <mail@3v1n0.net> dateFri 28 Oct 2016, 15:05 (10 years ago) parentbc584a7
1 file changed+8−1
tests/qmltests/Launcher/tst_Launcher.qml+8−1
tests/qmltests/Launcher/tst_Launcher.qml+8−1
@@ -261,9 +261,15 @@ Rectangle {
261261 // iteration to do its work. So to ensure the reload, we will wait until the
262262 // Shell instance gets destroyed.
263263 tryCompare(launcherLoader, "itemDestroyed", true);
264+ }
265+
266+ function initLauncher() {
264267 launcherLoader.active = true;
268+ tryCompare(launcherLoader, "itemDestroyed", false);
265269 }
270+
266271 function init() {
272+ initLauncher();
267273 var panel = findChild(launcher, "launcherPanel");
268274 verify(!!panel);
269275
@@ -279,7 +285,7 @@ Rectangle {
279285 // growing while populating it with icons etc.
280286 tryCompare(listView, "flicking", false);
281287
282− compare(listView.contentY, -listView.topMargin, "Launcher did not start up with first item unfolded");
288+ tryCompare(listView, "contentY", -listView.topMargin, 5000, "Launcher did not start up with first item unfolded");
283289
284290 // Now do check that snapping is in fact enabled
285291 compare(listView.snapMode, ListView.SnapToItem, "Snapping is not enabled");
@@ -534,6 +540,7 @@ Rectangle {
534540 }
535541
536542 function test_clickFlick_data() {
543+ initLauncher()
537544 var listView = findChild(launcher, "launcherListView");
538545 return [
539546 {tag: "unfolded top", positionViewAtBeginning: true,