@@ -76,6 +76,20 @@ Item {
76 spy.signalName = "";
76 spy.signalName = "";
79+ function scrollToCategory(category) {
80+ var categoryListView = findChild(genericScopeView, "categoryListView");
81+ tryCompareFunction(function() {
82+ if (findChild(genericScopeView, category)) return true;
83+ mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height,
84+ genericScopeView.width/2, genericScopeView.y)
85+ tryCompare(categoryListView, "moving", false);
86+ return findChild(genericScopeView, category) !== null;
89+ tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true);
90+ return findChild(genericScopeView, category);
79 function test_isActive() {
93 function test_isActive() {
80 tryCompare(genericScopeView.scope, "isActive", false)
94 tryCompare(genericScopeView.scope, "isActive", false)
81 genericScopeView.isCurrent = true
95 genericScopeView.isCurrent = true
@@ -222,12 +236,7 @@ Item {
224 function test_forced_category_expansion() {
238 function test_forced_category_expansion() {
225− tryCompareFunction(function() {
226− mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height,
227− genericScopeView.width/2, genericScopeView.y)
228− return findChild(genericScopeView, "dashCategory19") !== null;
230− var category = findChild(genericScopeView, "dashCategory19")
239+ var category = scrollToCategory("dashCategory19");
231 compare(category.expandable, false, "Category with collapsed-rows: 0 should not be expandable");
240 compare(category.expandable, false, "Category with collapsed-rows: 0 should not be expandable");
233 var grid = findChild(category, "19");
242 var grid = findChild(category, "19");
@@ -285,20 +294,13 @@ Item {
287 function test_showPreviewCarousel() {
296 function test_showPreviewCarousel() {
288− tryCompareFunction(function() {
297+ var category = scrollToCategory("dashCategory1");
289− var dashCategory1 = findChild(genericScopeView, "dashCategory1");
290− if (dashCategory1 != null) {
291− var tile = findChild(dashCategory1, "carouselDelegate1");
292− return tile != null;
298 tryCompare(testCase.previewListView, "open", false);
299 tryCompare(testCase.previewListView, "open", false);
300− var dashCategory1 = findChild(genericScopeView, "dashCategory1");
301− var tile = findChild(dashCategory1, "carouselDelegate1");
301+ var tile = findChild(category, "carouselDelegate1");
302+ verify(tile, "Could not find delegate");
302 mouseClick(tile, tile.width / 2, tile.height / 2);
304 mouseClick(tile, tile.width / 2, tile.height / 2);
303 tryCompare(tile, "explicitlyScaled", true);
305 tryCompare(tile, "explicitlyScaled", true);
304 mouseClick(tile, tile.width / 2, tile.height / 2);
306 mouseClick(tile, tile.width / 2, tile.height / 2);
@@ -306,6 +308,35 @@ Item {
306 tryCompare(testCase.previewListView, "x", 0);
308 tryCompare(testCase.previewListView, "x", 0);
308 closePreview();
310 closePreview();
312+ mousePress(tile, tile.width / 2, tile.height / 2);
313+ tryCompare(testCase.previewListView, "open", true);
314+ tryCompare(testCase.previewListView, "x", 0);
315+ mouseRelease(tile, tile.width / 2, tile.height / 2);
320+ function test_showPreviewHorizontalList() {
321+ var category = scrollToCategory("dashCategory18");
323+ tryCompare(testCase.previewListView, "open", false);
325+ var tile = findChild(category, "delegate1");
326+ verify(tile, "Could not find delegate");
328+ mouseClick(tile, tile.width / 2, tile.height / 2);
329+ tryCompare(testCase.previewListView, "open", true);
330+ tryCompare(testCase.previewListView, "x", 0);
334+ mousePress(tile, tile.width / 2, tile.height / 2);
335+ tryCompare(testCase.previewListView, "open", true);
336+ tryCompare(testCase.previewListView, "x", 0);
337+ mouseRelease(tile, tile.width / 2, tile.height / 2);
311 function test_previewCycle() {
342 function test_previewCycle() {