on xenial help sign in
testLauncher: use tryCompare to check launcher contentY
6480360Marco Trevisan (Treviño)
tests/qmltests/Launcher/tst_Launcher.qml+12−1
@@ -113,6 +113,10 @@ Rectangle {
113 }
113 }
114 Label {
114 Label {
115 text: "Launcher always visible"
115 text: "Launcher always visible"
116+ AbstractButton {
117+ anchors.fill: parent
118+ onClicked: lockedVisibleCheckBox.checked = !lockedVisibleCheckBox.checked
119+ }
116 }
120 }
117 }
121 }
118
122
@@ -261,9 +265,15 @@ Rectangle {
261 // iteration to do its work. So to ensure the reload, we will wait until the
265 // iteration to do its work. So to ensure the reload, we will wait until the
262 // Shell instance gets destroyed.
266 // Shell instance gets destroyed.
263 tryCompare(launcherLoader, "itemDestroyed", true);
267 tryCompare(launcherLoader, "itemDestroyed", true);
268+ }
269+
270+ function initLauncher() {
264 launcherLoader.active = true;
271 launcherLoader.active = true;
272+ tryCompare(launcherLoader, "itemDestroyed", false);
265 }
273 }
274+
266 function init() {
275 function init() {
276+ initLauncher();
267 var panel = findChild(launcher, "launcherPanel");
277 var panel = findChild(launcher, "launcherPanel");
268 verify(!!panel);
278 verify(!!panel);
269
279
@@ -279,7 +289,7 @@ Rectangle {
279 // growing while populating it with icons etc.
289 // growing while populating it with icons etc.
280 tryCompare(listView, "flicking", false);
290 tryCompare(listView, "flicking", false);
281
291
282− compare(listView.contentY, -listView.topMargin, "Launcher did not start up with first item unfolded");
292+ tryCompare(listView, "contentY", -listView.topMargin, 5000, "Launcher did not start up with first item unfolded");
283
293
284 // Now do check that snapping is in fact enabled
294 // Now do check that snapping is in fact enabled
285 compare(listView.snapMode, ListView.SnapToItem, "Snapping is not enabled");
295 compare(listView.snapMode, ListView.SnapToItem, "Snapping is not enabled");
@@ -538,6 +548,7 @@ Rectangle {
538 }
548 }
539
549
540 function test_clickFlick_data() {
550 function test_clickFlick_data() {
551+ initLauncher()
541 var listView = findChild(launcher, "launcherListView");
552 var listView = findChild(launcher, "launcherListView");
542 return [
553 return [
543 {tag: "unfolded top", positionViewAtBeginning: true,
554 {tag: "unfolded top", positionViewAtBeginning: true,
tests/utils/modules/Unity/Test/MouseTouchEmulationCheckbox.qml+4
@@ -40,5 +40,9 @@ RowLayout {
40 id: label
40 id: label
41 text: "Mouse emulates touch"
41 text: "Mouse emulates touch"
42 anchors.verticalCenter: parent.verticalCenter
42 anchors.verticalCenter: parent.verticalCenter
43+ AbstractButton {
44+ anchors.fill: parent
45+ onClicked: checkbox.checked = !checkbox.checked
46+ }
43 }
47 }
44}
48}