on xenial help sign in
More reliable compares
662e289Albert Astals Cid
tests/qmltests/Dash/Previews/tst_Preview.qml+5−6
@@ -121,15 +121,14 @@ Rectangle {
121 var moreLessButton = findChild(widget, "moreLessButton");
121 var moreLessButton = findChild(widget, "moreLessButton");
122 mouseClick(moreLessButton);
122 mouseClick(moreLessButton);
123
123
124− // Make sure the combo is growing
125− tryCompareFunction(function () { return widget.height > 2 * initialWidgetHeight; }, true);
126−
127 // Wait for the combo to stop growing
124 // Wait for the combo to stop growing
128− tryCompareFunction(function () { var currentWidgetHeight = widget.height; wait(200); return currentWidgetHeight === widget.height;}, true);
125+ tryCompare(widget, "height", units.gu(15));
129
126
130 // Make sure the combo bottom is on the viewport
127 // Make sure the combo bottom is on the viewport
128+ tryCompareFunction(function () {
131− var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
129+ var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
132− verify(bottomLeft.y <= preview.height);
130+ return bottomLeft.y <= preview.height
131+ }, true);
133 }
132 }
134 }
133 }
135}
134}