@@ -78,6 +78,20 @@ Item {
78 spy.signalName = "";
78 spy.signalName = "";
81+ function scrollToCategory(category) {
82+ var categoryListView = findChild(genericScopeView, "categoryListView");
83+ tryCompareFunction(function() {
84+ if (findChild(genericScopeView, category)) return true;
85+ mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height,
86+ genericScopeView.width/2, genericScopeView.y)
87+ tryCompare(categoryListView, "moving", false);
88+ return findChild(genericScopeView, category) !== null;
91+ tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true);
92+ return findChild(genericScopeView, category);
81 function test_isActive() {
95 function test_isActive() {
82 tryCompare(genericScopeView.scope, "isActive", false)
96 tryCompare(genericScopeView.scope, "isActive", false)
83 genericScopeView.isCurrent = true
97 genericScopeView.isCurrent = true
@@ -224,12 +238,7 @@ Item {
226 function test_forced_category_expansion() {
240 function test_forced_category_expansion() {
227− tryCompareFunction(function() {
228− mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height,
229− genericScopeView.width/2, genericScopeView.y)
230− return findChild(genericScopeView, "dashCategory19") !== null;
232− var category = findChild(genericScopeView, "dashCategory19")
241+ var category = scrollToCategory("dashCategory19");
233 compare(category.expandable, false, "Category with collapsed-rows: 0 should not be expandable");
242 compare(category.expandable, false, "Category with collapsed-rows: 0 should not be expandable");
235 var grid = findChild(category, "19");
244 var grid = findChild(category, "19");
@@ -287,20 +296,13 @@ Item {
289 function test_showPreviewCarousel() {
298 function test_showPreviewCarousel() {
290− tryCompareFunction(function() {
299+ var category = scrollToCategory("dashCategory1");
291− var dashCategory1 = findChild(genericScopeView, "dashCategory1");
292− if (dashCategory1 != null) {
293− var tile = findChild(dashCategory1, "carouselDelegate1");
294− return tile != null;
300 tryCompare(testCase.subPageLoader, "open", false);
301 tryCompare(testCase.subPageLoader, "open", false);
302− var dashCategory1 = findChild(genericScopeView, "dashCategory1");
303− var tile = findChild(dashCategory1, "carouselDelegate1");
303+ var tile = findChild(category, "carouselDelegate1");
304+ verify(tile, "Could not find delegate");
304 mouseClick(tile, tile.width / 2, tile.height / 2);
306 mouseClick(tile, tile.width / 2, tile.height / 2);
305 tryCompare(tile, "explicitlyScaled", true);
307 tryCompare(tile, "explicitlyScaled", true);
306 mouseClick(tile, tile.width / 2, tile.height / 2);
308 mouseClick(tile, tile.width / 2, tile.height / 2);
@@ -308,6 +310,35 @@ Item {
308 tryCompare(testCase.subPageLoader, "x", 0);
310 tryCompare(testCase.subPageLoader, "x", 0);
310 closePreview();
312 closePreview();
314+ mousePress(tile, tile.width / 2, tile.height / 2);
315+ tryCompare(testCase.subPageLoader, "open", true);
316+ tryCompare(testCase.subPageLoader, "x", 0);
317+ mouseRelease(tile, tile.width / 2, tile.height / 2);
322+ function test_showPreviewHorizontalList() {
323+ var category = scrollToCategory("dashCategory18");
325+ tryCompare(testCase.subPageLoader, "open", false);
327+ var tile = findChild(category, "delegate1");
328+ verify(tile, "Could not find delegate");
330+ mouseClick(tile, tile.width / 2, tile.height / 2);
331+ tryCompare(testCase.subPageLoader, "open", true);
332+ tryCompare(testCase.subPageLoader, "x", 0);
336+ mousePress(tile, tile.width / 2, tile.height / 2);
337+ tryCompare(testCase.subPageLoader, "open", true);
338+ tryCompare(testCase.subPageLoader, "x", 0);
339+ mouseRelease(tile, tile.width / 2, tile.height / 2);
313 function test_previewCycle() {
344 function test_previewCycle() {
@@ -379,6 +410,7 @@ Item {
379 verify(background, "Could not find the background");
410 verify(background, "Could not find the background");
380 compare(background.style, data.background);
411 compare(background.style, data.background);
413+ wait(50) // XXX Cimi my machine needs this to pass the following checks
382 var image = findChild(genericScopeView, "titleImage");
414 var image = findChild(genericScopeView, "titleImage");
383 if (data.logo == "") expectFail(data.tag, "Title image should not exist.");
415 if (data.logo == "") expectFail(data.tag, "Title image should not exist.");
384 verify(image, "Could not find the title image.");
416 verify(image, "Could not find the title image.");