@@ -70,6 +70,42 @@ Item {
70 waitForRendering(findChild(dash, "scopeLoader0").item);
70 waitForRendering(findChild(dash, "scopeLoader0").item);
73+ function scrollToCategory(categoryName) {
74+ var dashContentList = findChild(dash, "dashContentList");
75+ var genericScopeView = dashContentList.currentItem;
76+ var categoryListView = findChild(genericScopeView, "categoryListView");
77+ tryCompareFunction(function() {
78+ var category = findChild(genericScopeView, categoryName);
79+ if (category && category.y > 0 && category.y < genericScopeView.height) return true;
80+ touchFlick(genericScopeView, genericScopeView.width/2, units.gu(20),
81+ genericScopeView.width/2, genericScopeView.y)
82+ tryCompare(categoryListView, "moving", false);
86+ tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true);
87+ return findChild(genericScopeView, categoryName);
90+ function clickCategoryDelegate(category, delegate) {
91+ var dashContentList = findChild(dash, "dashContentList");
92+ var genericScopeView = dashContentList.currentItem;
93+ if (category === undefined) category = 0;
94+ if (delegate === undefined) delegate = 0;
95+ tryCompareFunction(function() {
96+ var cardGrid = findChild(genericScopeView, "dashCategory"+category);
97+ if (cardGrid != null) {
98+ var tile = findChild(cardGrid, "delegate"+delegate);
104+ var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
105+ waitForRendering(tile);
73 function test_manage_dash_clickscope_unfavoritable() {
109 function test_manage_dash_clickscope_unfavoritable() {
74 // Show the manage dash
110 // Show the manage dash
75 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
111 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
@@ -566,6 +602,27 @@ Item {
566 tryCompare(dashTempScopeItem, "visible", false);
602 tryCompare(dashTempScopeItem, "visible", false);
605+ function test_openScope()
607+ scrollToCategory("dashCategory2");
608+ clickCategoryDelegate(2, 2);
610+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
611+ tryCompare(dashTempScopeItem, "x", 0);
612+ tryCompare(dashTempScopeItem, "visible", true);
613+ tryCompare(dashContent, "x", -dash.width);
616+ var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
617+ var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
618+ mouseClick(backButton);
620+ // Check temp scope is gone
621+ tryCompare(dashTempScopeItem, "x", dash.width);
622+ tryCompare(dashTempScopeItem, "visible", false);
623+ tryCompare(dashContent, "x", 0);
569 function test_tempScopeItemXOnResize()
626 function test_tempScopeItemXOnResize()
571 // Go to a temp scope
628 // Go to a temp scope
@@ -582,6 +639,7 @@ Item {
583 shell.width = units.gu(80);
640 shell.width = units.gu(80);
584 tryCompare(dashTempScopeItem, "x", 0);
641 tryCompare(dashTempScopeItem, "x", 0);
642+ tryCompare(dashContent, "x", -dash.width);
586 shell.width = units.gu(40);
644 shell.width = units.gu(40);
587 tryCompare(dashTempScopeItem, "x", 0);
645 tryCompare(dashTempScopeItem, "x", 0);
@@ -594,6 +652,7 @@ Item {
594 // Check temp scope is gone
652 // Check temp scope is gone
595 tryCompare(dashTempScopeItem, "x", dash.width);
653 tryCompare(dashTempScopeItem, "x", dash.width);
596 tryCompare(dashTempScopeItem, "visible", false);
654 tryCompare(dashTempScopeItem, "visible", false);
655+ tryCompare(dashContent, "x", 0);