on xenial help sign in
testLauncher: use tryCompare to check launcher contentY
e1b8fa8Marco Trevisan (Treviño)
tests/qmltests/Launcher/tst_Launcher.qml+8−1
@@ -261,9 +261,15 @@ Rectangle {
261 // iteration to do its work. So to ensure the reload, we will wait until the
261 // iteration to do its work. So to ensure the reload, we will wait until the
262 // Shell instance gets destroyed.
262 // Shell instance gets destroyed.
263 tryCompare(launcherLoader, "itemDestroyed", true);
263 tryCompare(launcherLoader, "itemDestroyed", true);
264+ }
265+
266+ function initLauncher() {
264 launcherLoader.active = true;
267 launcherLoader.active = true;
268+ tryCompare(launcherLoader, "itemDestroyed", false);
265 }
269 }
270+
266 function init() {
271 function init() {
272+ initLauncher();
267 var panel = findChild(launcher, "launcherPanel");
273 var panel = findChild(launcher, "launcherPanel");
268 verify(!!panel);
274 verify(!!panel);
269
275
@@ -279,7 +285,7 @@ Rectangle {
279 // growing while populating it with icons etc.
285 // growing while populating it with icons etc.
280 tryCompare(listView, "flicking", false);
286 tryCompare(listView, "flicking", false);
281
287
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");
283
289
284 // Now do check that snapping is in fact enabled
290 // Now do check that snapping is in fact enabled
285 compare(listView.snapMode, ListView.SnapToItem, "Snapping is not enabled");
291 compare(listView.snapMode, ListView.SnapToItem, "Snapping is not enabled");
@@ -534,6 +540,7 @@ Rectangle {
534 }
540 }
535
541
536 function test_clickFlick_data() {
542 function test_clickFlick_data() {
543+ initLauncher()
537 var listView = findChild(launcher, "launcherListView");
544 var listView = findChild(launcher, "launcherListView");
538 return [
545 return [
539 {tag: "unfolded top", positionViewAtBeginning: true,
546 {tag: "unfolded top", positionViewAtBeginning: true,