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