@@ -87,21 +87,29 @@ Rectangle {
88 function test_containOnFocus() {
88 function test_containOnFocus() {
89 waitForRendering(preview);
89 waitForRendering(preview);
90+ tryCompareFunction(function () { return findChild(preview, "widget-9") != null }, true);
90− var widget = findChild(preview, "widget-13");
91+ var widget = findChild(preview, "widget-9");
92− widget.forceActiveFocus();
94 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
93 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
94+ verify(bottomLeft.y > preview.height);
96+ widget.forceActiveFocus();
98+ tryCompareFunction(function () {
99+ var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
96− tryCompareFunction(function () { return bottomLeft.y <= preview.height }, true);
100+ return bottomLeft.y <= preview.height
99 function test_containOnGrow() {
104 function test_containOnGrow() {
100 waitForRendering(preview);
105 waitForRendering(preview);
106+ tryCompareFunction(function () { return findChild(preview, "widget-13") != null }, true);
101 var widget = findChild(preview, "widget-13");
107 var widget = findChild(preview, "widget-13");
103− widget.forceActiveFocus();
109+ var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
104− widget.height += 200;
110+ verify(bottomLeft.y > preview.height);
112+ root.height += units.gu(50);
106 tryCompareFunction(function () {
114 tryCompareFunction(function () {
107 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
115 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);