@@ -23,6 +23,7 @@ import Unity 0.2
23import Unity.Test 0.1 as UT
23import Unity.Test 0.1 as UT
26 width: units.gu(110)
27 width: units.gu(110)
27 height: units.gu(30)
28 height: units.gu(30)
@@ -167,7 +168,14 @@ Item {
167 tryCompare(headerContainer.popover, "visible", true);
168 tryCompare(headerContainer.popover, "visible", true);
170− function test_resetSearch_closes_popup() {
171+ function test_tap_outside_closes_popup_data() {
173+ { tag: "with search text", searchText: "foobar", hideSearch: false },
174+ { tag: "without search text", searchText: "", hideSearch: true }
178+ function test_tap_outside_closes_popup(data) {
171 searchEnabled = true;
179 searchEnabled = true;
172 pageHeader.searchHistory.clear();
180 pageHeader.searchHistory.clear();
@@ -181,11 +189,14 @@ Item {
181 tryCompareFunction(function() { return headerContainer.popover !== null; }, true);
189 tryCompareFunction(function() { return headerContainer.popover !== null; }, true);
182 compare(headerContainer.popover.visible, true);
190 compare(headerContainer.popover.visible, true);
184− pageHeader.searchQuery = "test";
192+ pageHeader.searchQuery = data.searchText;
194+ mouseClick(root, root.width / 2, root.height - 1);
196+ tryCompare(headerContainer, "showSearch", !data.hideSearch);
185− tryCompareFunction( function() { return (headerContainer.popover===null || !headerContainer.popover.visible) }, true);
197+ tryCompareFunction(function() { return headerContainer.popover === null; }, true);
187 pageHeader.resetSearch();
199 pageHeader.resetSearch();
188− compare((headerContainer.popover===null || !headerContainer.popover.visible), true);