76
76
var genericScopeView = dashContentList.currentItem;
77
77
var categoryListView = findChild(genericScopeView, "categoryListView");
78
78
tryCompareFunction(function() {
79
var category = findChild(genericScopeView, categoryName);
79
var category = findChild(genericScopeView, categoryName, 0 /* timeout */);
80
80
if (category && category.y > 0 && category.y < genericScopeView.height) return true;
81
81
touchFlick(genericScopeView, genericScopeView.width/2, units.gu(20),
82
82
genericScopeView.width/2, genericScopeView.y)
87
tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true);
87
tryCompareFunction(function() { return findChild(genericScopeView, "delegate0", 0 /* timeout */) !== null; }, true);
88
88
return findChild(genericScopeView, categoryName);
94
94
if (category === undefined) category = 0;
95
95
if (delegate === undefined) delegate = 0;
96
96
tryCompareFunction(function() {
97
var cardGrid = findChild(genericScopeView, "dashCategory"+category);
97
var cardGrid = findChild(genericScopeView, "dashCategory"+category, 0 /* timeout */);
98
98
if (cardGrid != null) {
99
var tile = findChild(cardGrid, "delegate"+delegate);
99
var tile = findChild(cardGrid, "delegate"+delegate, 0 /* timeout */);
100
100
return tile != null;
216
216
// Click in first item
217
217
var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
218
tryCompareFunction(function() { return favScopesListCategoryList.currentItem !== null }, true);
219
waitForRendering(favScopesListCategoryList.currentItem);
218
220
mouseClick(favScopesListCategoryList.currentItem);
220
222
// Make sure animation went back
409
411
compare(dashContentList.currentItem.scopeId, "clickscope");
411
413
// Move to second scope
412
touchFlick(dash, dash.width / 2, units.gu(2), dash.width / 5, units.gu(2));
414
mouseFlick(dash, dash.width / 2, units.gu(2), dash.width / 5, units.gu(2));
413
415
tryCompare(dashContentList, "currentIndex", 1);
414
416
compare(dashContentList.currentItem.scopeId, "MockScope1");
473
475
compare(dashContentList.currentItem.scopeId, "MockScope1");
475
477
tryCompareFunction(function() {
476
var cardGrid = findChild(dashContentList, "dashCategory0");
478
var cardGrid = findChild(dashContentList, "dashCategory0", 0 /* timeout */);
477
479
if (cardGrid != null) {
478
var tile = findChild(cardGrid, "delegate0");
480
var tile = findChild(cardGrid, "delegate0", 0 /* timeout */);
479
481
return tile != null;
520
522
var categoryListView = findChild(dashTempScopeItem, "categoryListView");
521
523
categoryListView.positionAtBeginning();
522
524
tryCompareFunction(function() {
523
var cardGrid = findChild(dashTempScopeItem, "dashCategory0");
525
var cardGrid = findChild(dashTempScopeItem, "dashCategory0", 0 /* timeout */);
524
526
if (cardGrid != null) {
525
var tile = findChild(cardGrid, "delegate0");
527
var tile = findChild(cardGrid, "delegate0", 0 /* timeout */);
526
528
return tile != null;
631
633
tryCompare(dashContent.currentScope, "id", "clickscope");
633
635
scrollToCategory("dashCategorypredefined");
634
var tile = getCategoryDelegate("predefined", 2);
635
var proportionalShape = findChildsByType(tile, "UCProportionalShape");
636
compare(proportionalShape.length, 1);
636
tryCompareFunction(function() {
637
var tile = getCategoryDelegate("predefined", 2);
638
var proportionalShape = findChildsByType(tile, "UCProportionalShape");
639
return proportionalShape.length === 1;
638
644
dash.setCurrentScope("libertine-scope.ubuntu_libertine-scope");
639
645
var dashContent = findChild(dash, "dashContent");
640
646
tryCompare(dashContent.currentScope, "id", "libertine-scope.ubuntu_libertine-scope");
642
648
scrollToCategory("dashCategory2");
643
tile = getCategoryDelegate("2", 2);
644
proportionalShape = findChildsByType(tile, "UCProportionalShape");
645
compare(proportionalShape.length, 1);
649
tryCompareFunction(function() {
650
var tile = getCategoryDelegate("2", 2);
651
var proportionalShape = findChildsByType(tile, "UCProportionalShape");
652
return proportionalShape.length === 1;
648
658
function test_tempScopeItemXOnResize()