@@ -54,6 +54,11 @@ Rectangle {
54 name: "Preview"
54 name: "Preview"
55 when: windowShown
55 when: windowShown
58+ var widget = findChild(preview, "previewListRow0");
59+ widget.positionViewAtBeginning();
57 function test_triggered() {
62 function test_triggered() {
58 waitForRendering(preview);
63 waitForRendering(preview);
59 var widget = findChild(preview, "widget-3");
64 var widget = findChild(preview, "widget-3");
@@ -102,5 +107,31 @@ Rectangle {
102 return bottomLeft.y <= preview.height
107 return bottomLeft.y <= preview.height
103 }, true);
108 }, true);
111+ function test_comboEnsureVisible() {
112+ waitForRendering(preview);
115+ var previewListRow0 = findChild(preview, "previewListRow0");
116+ touchFlick(preview, preview.width / 2, units.gu(20), preview.width / 2, units.gu(1));
117+ tryCompare(previewListRow0, "atYEnd", true);
118+ tryCompare(previewListRow0, "moving", false);
120+ // Click on the combo
121+ var widget = findChild(preview, "widget-21");
122+ var initialWidgetHeight = widget.height;
123+ var moreLessButton = findChild(widget, "moreLessButton");
124+ mouseClick(moreLessButton);
126+ // Make sure the combo is growing
127+ tryCompareFunction(function () { return widget.height > 2 * initialWidgetHeight; }, true);
129+ // Wait for the combo to stop growing
130+ tryCompareFunction(function () { var currentWidgetHeight = widget.height; wait(200); return currentWidgetHeight === widget.height;}, true);
132+ // Make sure the combo bottom is on the viewport
133+ var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
134+ verify(bottomLeft.y <= preview.height);