@@ -79,173 +79,108 @@ Item {
79 return get_scope_data()
79 return get_scope_data()
82− function test_dash_overview_show_select_same_favorite() {
82+ function test_manage_dash_select_same_favorite() {
83− // Show the overview
83+ // Show the manage dash
84− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
84+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
85− var overviewController = findInvisibleChild(dash, "overviewController");
85+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
86− tryCompare(overviewController, "progress", 1);
86+ tryCompare(bottomEdgeController, "progress", 1);
88− // Make sure tab is where it should
89− var scopesOverview = findChild(dash, "scopesOverview");
90− compare(scopesOverview.currentTab, 0);
92 // Make sure stuff is loaded
88 // Make sure stuff is loaded
93− var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
89+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
94− tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
90+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
95− tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
91+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
96− waitForRendering(scopesOverviewFavoritesRepeater.itemAt(0).item);
98 // Click in first item
93 // Click in first item
99− mouseClick(scopesOverviewFavoritesRepeater.itemAt(0).item, 0, 0);
94+ mouseClick(favScopesListCategoryList.currentItem, 0, 0);
101 // Make sure animation went back
96 // Make sure animation went back
102− tryCompare(overviewController, "progress", 0);
97+ tryCompare(bottomEdgeController, "progress", 0);
104 var dashContentList = findChild(dash, "dashContentList");
99 var dashContentList = findChild(dash, "dashContentList");
105 compare(dashContentList.currentIndex, 0);
100 compare(dashContentList.currentIndex, 0);
108− function test_dash_overview_show_select_different_favorite() {
103+ function test_manage_dash_select_different_favorite() {
109− // Show the overview
104+ // Show the manage dash
110− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
105+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
111− var overviewController = findInvisibleChild(dash, "overviewController");
106+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
112− tryCompare(overviewController, "progress", 1);
107+ tryCompare(bottomEdgeController, "progress", 1);
114− // Make sure tab is where it should
115− var scopesOverview = findChild(dash, "scopesOverview");
116− compare(scopesOverview.currentTab, 0);
118 // Make sure stuff is loaded
109 // Make sure stuff is loaded
119− var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
110+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
120− tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
111+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
121− tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
112+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
122− waitForRendering(scopesOverviewFavoritesRepeater.itemAt(1).item);
124− // Click in first item
114+ // Click in second item
125− mouseClick(scopesOverviewFavoritesRepeater.itemAt(1).item, 0, 0);
115+ favScopesListCategoryList.currentIndex = 1;
116+ mouseClick(favScopesListCategoryList.currentItem, 0, 0);
127 // Make sure animation went back
118 // Make sure animation went back
128− tryCompare(overviewController, "progress", 0);
119+ tryCompare(bottomEdgeController, "progress", 0);
129 var dashContentList = findChild(dash, "dashContentList");
120 var dashContentList = findChild(dash, "dashContentList");
130 compare(dashContentList.currentIndex, 1);
121 compare(dashContentList.currentIndex, 1);
133− function test_dash_overview_all_temp_scope_done_from_all() {
124+ function test_manage_dash_select_non_favorite() {
134− // Show the overview
125+ // Show the manage dash
135− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
126+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
136− var overviewController = findInvisibleChild(dash, "overviewController");
127+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
137− tryCompare(overviewController, "progress", 1);
128+ tryCompare(bottomEdgeController, "progress", 1);
139− // Make sure tab is where it should
140− var scopesOverview = findChild(dash, "scopesOverview");
141− compare(scopesOverview.currentTab, 0);
143 // Make sure stuff is loaded
130 // Make sure stuff is loaded
144− var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
131+ var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
145− tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
132+ var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
146− tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
133+ tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
147− waitForRendering(scopesOverviewFavoritesRepeater.itemAt(1).item);
149− // Click on the all tab
150− var scopesOverviewAllTabButton = findChild(dash, "scopesOverviewAllTabButton");
151− mouseClick(scopesOverviewAllTabButton, 0, 0);
153− // Wait for all tab to be enabled (animation finish)
154− var scopesOverviewAllView = findChild(dash, "scopesOverviewRepeaterChild1");
155− tryCompare(scopesOverviewAllView, "enabled", true);
157− // Click in the middle of the black bar (nothing happens)
158− var bottomBar = findChild(scopesOverview, "bottomBar");
159− mouseClick(bottomBar, bottomBar.width / 2, bottomBar.height / 2);
160− // Check temp scope is not there
161− var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem");
162− expectFailContinue("", "Clicking in the middle of bottom bar should not open a temp scope");
163− tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope != null; }, true);
165− // Click on a temp scope
166− var tempScopeCard = findChild(scopesOverviewAllView, "delegate1");
167− mouseClick(tempScopeCard, 0, 0);
135+ // Click on a non favorite scope
136+ mouseClick(nonfavScopesListCategoryList.currentItem, 0, 0);
169− // Check the bottom edge (overview) is disabled from temp scope
138+ // Check the bottom edge (manage dash) is disabled from temp scope
170 var overviewDragHandle = findChild(dash, "overviewDragHandle");
139 var overviewDragHandle = findChild(dash, "overviewDragHandle");
171 compare(overviewDragHandle.enabled, false);
140 compare(overviewDragHandle.enabled, false);
173 // Check temp scope is there
142 // Check temp scope is there
174− tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope != null; }, true);
143+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
175− tryCompare(scopesOverviewTempScopeItem, "enabled", true);
144+ tryCompare(dashTempScopeItem, "x", 0);
145+ tryCompare(dashTempScopeItem, "visible", true);
147+ // Check the manage dash is gone
148+ tryCompare(bottomEdgeController, "progress", 0);
177 // Go back
150 // Go back
178− var scopesOverviewTempScopeItemHeader = findChild(scopesOverviewTempScopeItem, "scopePageHeader");
151+ var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
179− var backButton = findChild(findChild(scopesOverviewTempScopeItemHeader, "innerPageHeader"), "backButton");
152+ var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "backButton");
180 mouseClick(backButton, 0, 0);
153 mouseClick(backButton, 0, 0);
182 // Check temp scope is gone
155 // Check temp scope is gone
183− var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem");
156+ tryCompare(dashTempScopeItem, "x", dash.width);
184− tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope == null; }, true);
157+ tryCompare(dashTempScopeItem, "visible", false);
185− tryCompare(scopesOverviewTempScopeItem, "enabled", false);
188− var scopesOverviewDoneButton = findChild(scopesOverview, "scopesOverviewDoneButton");
189− mouseClick(scopesOverviewDoneButton, 0, 0);
191− // Check the dash overview is gone
192− tryCompare(overviewController, "progress", 0);
194 // Original list is still on 0
159 // Original list is still on 0
195 var dashContentList = findChild(dash, "dashContentList");
160 var dashContentList = findChild(dash, "dashContentList");
196 compare(dashContentList.currentIndex, 0);
161 compare(dashContentList.currentIndex, 0);
199− function test_temp_scope_dash_overview_all_search_temp_scope_favorite_from_all() {
164+ function test_manage_dash_search_temp_scope() {
200− // Swipe right to Apps scope
201− var dashContentList = findChild(dash, "dashContentList");
202− touchFlick(dash, dash.width - 1, units.gu(1), dash.width - units.gu(10), units.gu(1));
203− tryCompare(dashContentList, "contentX", dashContentList.width);
204− tryCompare(dashContentList, "currentIndex", 1);
206− // Click on card that opens temp scope
207− var categoryListView = findChild(dashContentList.currentItem, "categoryListView");
208− var dashCategory2 = findChild(categoryListView, "dashCategory2");
209− tryCompareFunction(function() {
210− if (dashCategory2.y < 200) return true;
211− categoryListView.contentY += 100;
214− var card2 = findChild(dashCategory2, "delegate2");
215− waitForRendering(card2);
216− mouseClick(card2, card2.width / 2, card2.height / 2);
218− // Wait for temp scope to be there
219− var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
220− tryCompare(dashTempScopeItem, "x", 0);
222− // Show the overview
165+ // Show the manage dash
223− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
166+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
224− var overviewController = findInvisibleChild(dash, "overviewController");
167+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
225− tryCompare(overviewController, "progress", 1);
168+ tryCompare(bottomEdgeController, "progress", 1);
227− // Make sure tab is where it should
228− var scopesOverview = findChild(dash, "scopesOverview");
229− compare(scopesOverview.currentTab, 1);
231 // Do a search
170 // Do a search
232− var scopesOverviewPageHeader = findChild(scopesOverview, "scopesOverviewPageHeader");
171+ var scopesList = findChild(dash, "scopesList");
172+ var scopesListPageHeader = findChild(scopesList, "pageHeader");
233− var searchButton = findChild(scopesOverviewPageHeader, "search_header_button");
173+ var searchButton = findChild(scopesListPageHeader, "search_header_button");
234 mouseClick(searchButton, 0, 0);
174 mouseClick(searchButton, 0, 0);
236 // Type something
176 // Type something
237 keyClick(Qt.Key_H);
177 keyClick(Qt.Key_H);
239− // Check results grid is there and the other lists are not
240− var searchResultsViewer = findChild(scopesOverview, "searchResultsViewer");
241− var scopesOverviewRepeater = findChild(dash, "scopesOverviewRepeater");
242− tryCompare(searchResultsViewer, "opacity", 1);
243− tryCompare(scopesOverviewRepeater, "count", 0);
245 // Click on a temp scope in the search
179 // Click on a temp scope in the search
180+ tryCompareFunction( function() { return findChild(scopesList, "scopesListCategorysearchA") != null; }, true);
246− var dashCategorysearchA = findChild(searchResultsViewer, "dashCategorysearchA");
181+ var dashCategorysearchA = findChild(scopesList, "scopesListCategorysearchA");
182+ tryCompareFunction( function() { return findChild(dashCategorysearchA, "delegate2") != null; }, true);
247 var cardTempScope = findChild(dashCategorysearchA, "delegate2");
183 var cardTempScope = findChild(dashCategorysearchA, "delegate2");
248− verify(cardTempScope, "Could not find delegate2");
250 waitForRendering(cardTempScope);
185 waitForRendering(cardTempScope);
251 mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2);
186 mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2);
@@ -255,29 +190,24 @@ Item {
255 compare(overviewDragHandle.enabled, false);
190 compare(overviewDragHandle.enabled, false);
257 // Check temp scope is there
192 // Check temp scope is there
258− var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem");
193+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
259− tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope != null; }, true);
194+ tryCompare(dashTempScopeItem, "x", 0);
260− tryCompare(scopesOverviewTempScopeItem, "enabled", true);
195+ tryCompare(dashTempScopeItem, "visible", true);
197+ // Check the manage dash is gone
198+ tryCompare(bottomEdgeController, "progress", 0);
262 // Go back
200 // Go back
263− var scopesOverviewTempScopeItemHeader = findChild(scopesOverviewTempScopeItem, "scopePageHeader");
201+ var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
264− var backButton = findChild(findChild(scopesOverviewTempScopeItemHeader, "innerPageHeader"), "backButton");
202+ var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "backButton");
265 mouseClick(backButton, 0, 0);
203 mouseClick(backButton, 0, 0);
267 // Check temp scope is gone
205 // Check temp scope is gone
268− var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem");
206+ tryCompare(dashTempScopeItem, "x", dash.width);
269− tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope == null; }, true);
207+ tryCompare(dashTempScopeItem, "visible", false);
270− tryCompare(scopesOverviewTempScopeItem, "enabled", false);
272− // Press on a favorite
209+ // Original list is still on 0
273− var dashCategorysearchB = findChild(searchResultsViewer, "dashCategorysearchB");
210+ var dashContentList = findChild(dash, "dashContentList");
274− var cardFavSearch = findChild(dashCategorysearchB, "delegate3");
275− mouseClick(cardFavSearch, 0, 0);
277− // Check the dash overview is gone
278− tryCompare(overviewController, "progress", 0);
280− // Original list went to the favorite
281 compare(dashContentList.currentIndex, 0);
211 compare(dashContentList.currentIndex, 0);
@@ -298,6 +228,22 @@ Item {
298 tryCompare(dashContentList, "currentIndex", 1)
228 tryCompare(dashContentList, "currentIndex", 1)
231+ function test_setCurrentScopeClosesPreview() {
232+ var dashContent = findChild(dash, "dashContent");
233+ waitForRendering(dash)
235+ var delegate0 = findChild(dash, "delegate0");
236+ mouseClick(delegate0, delegate0.width / 2, delegate0.height / 2);
238+ tryCompare(dashContent, "subPageShown", true)
239+ waitForRendering(dash);
241+ var dashCommunicatorService = findInvisibleChild(dash, "dashCommunicatorService");
242+ dashCommunicatorService.mockSetCurrentScope(0, true, false);
244+ tryCompare(dashContent, "subPageShown", false)
301 function test_processing_indicator() {
247 function test_processing_indicator() {
302 var processingIndicator = findChild(dash, "processingIndicator");
248 var processingIndicator = findChild(dash, "processingIndicator");
303 verify(processingIndicator, "Can't find the processing indicator.");
249 verify(processingIndicator, "Can't find the processing indicator.");