@@ -79,175 +79,108 @@ Item {
7979 return get_scope_data()
8080 }
8181
82− function test_dash_overview_show_select_same_favorite() {
83− // Show the overview
84− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
85− var overviewController = findInvisibleChild(dash, "overviewController");
86− tryCompare(overviewController, "progress", 1);
87−
88− // Make sure tab is where it should
89− var scopesOverview = findChild(dash, "scopesOverview");
90− compare(scopesOverview.currentTab, 0);
82+ function test_manage_dash_select_same_favorite() {
83+ // Show the manage dash
84+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
85+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
86+ tryCompare(bottomEdgeController, "progress", 1);
9187
9288 // Make sure stuff is loaded
93− var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
94− tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
95− tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
96− waitForRendering(scopesOverviewFavoritesRepeater.itemAt(0).item);
89+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
90+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
91+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
9792
9893 // Click in first item
99− mouseClick(scopesOverviewFavoritesRepeater.itemAt(0).item, 0, 0);
94+ mouseClick(favScopesListCategoryList.currentItem, 0, 0);
10095
10196 // Make sure animation went back
102− tryCompare(overviewController, "progress", 0);
97+ tryCompare(bottomEdgeController, "progress", 0);
10398
10499 var dashContentList = findChild(dash, "dashContentList");
105100 compare(dashContentList.currentIndex, 0);
106101 }
107102
108− function test_dash_overview_show_select_different_favorite() {
109− // Show the overview
110− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
111− var overviewController = findInvisibleChild(dash, "overviewController");
112− tryCompare(overviewController, "progress", 1);
113−
114− // Make sure tab is where it should
115− var scopesOverview = findChild(dash, "scopesOverview");
116− compare(scopesOverview.currentTab, 0);
103+ function test_manage_dash_select_different_favorite() {
104+ // Show the manage dash
105+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
106+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
107+ tryCompare(bottomEdgeController, "progress", 1);
117108
118109 // Make sure stuff is loaded
119− var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
120− tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
121− tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
122− waitForRendering(scopesOverviewFavoritesRepeater.itemAt(1).item);
110+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
111+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
112+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
123113
124− // Click in first item
125− mouseClick(scopesOverviewFavoritesRepeater.itemAt(1).item, 0, 0);
114+ // Click in second item
115+ favScopesListCategoryList.currentIndex = 1;
116+ mouseClick(favScopesListCategoryList.currentItem, 0, 0);
126117
127118 // Make sure animation went back
128− tryCompare(overviewController, "progress", 0);
119+ tryCompare(bottomEdgeController, "progress", 0);
129120 var dashContentList = findChild(dash, "dashContentList");
130121 compare(dashContentList.currentIndex, 1);
131122 }
132123
133− function test_dash_overview_all_temp_scope_done_from_all() {
134− // Show the overview
135− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
136− var overviewController = findInvisibleChild(dash, "overviewController");
137− tryCompare(overviewController, "progress", 1);
138−
139− // Make sure tab is where it should
140− var scopesOverview = findChild(dash, "scopesOverview");
141− compare(scopesOverview.currentTab, 0);
124+ function test_manage_dash_select_non_favorite() {
125+ // Show the manage dash
126+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
127+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
128+ tryCompare(bottomEdgeController, "progress", 1);
142129
143130 // Make sure stuff is loaded
144− var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
145− tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
146− tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
147− waitForRendering(scopesOverviewFavoritesRepeater.itemAt(1).item);
148−
149− // Click on the all tab
150− var scopesOverviewAllTabButton = findChild(dash, "scopesOverviewAllTabButton");
151− mouseClick(scopesOverviewAllTabButton, 0, 0);
152−
153− // Wait for all tab to be enabled (animation finish)
154− var scopesOverviewAllView = findChild(dash, "scopesOverviewRepeaterChild1");
155− tryCompare(scopesOverviewAllView, "enabled", true);
156−
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);
164−
165− // Click on a temp scope
166− var tempScopeCard = findChild(scopesOverviewAllView, "delegate1");
167− mouseClick(tempScopeCard, 0, 0);
131+ var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
132+ var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
133+ tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
168134
169− // Check the bottom edge (overview) is disabled from temp scope
135+ // Click on a non favorite scope
136+ mouseClick(nonfavScopesListCategoryList.currentItem, 0, 0);
137+
138+ // Check the bottom edge (manage dash) is disabled from temp scope
170139 var overviewDragHandle = findChild(dash, "overviewDragHandle");
171140 compare(overviewDragHandle.enabled, false);
172141
173142 // Check temp scope is there
174− tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope != null; }, true);
175− tryCompare(scopesOverviewTempScopeItem, "enabled", true);
143+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
144+ tryCompare(dashTempScopeItem, "x", 0);
145+ tryCompare(dashTempScopeItem, "visible", true);
146+
147+ // Check the manage dash is gone
148+ tryCompare(bottomEdgeController, "progress", 0);
176149
177150 // Go back
178− var scopesOverviewTempScopeItemHeader = findChild(scopesOverviewTempScopeItem, "scopePageHeader");
179− var backButton = findChild(findChild(scopesOverviewTempScopeItemHeader, "innerPageHeader"), "backButton");
151+ var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
152+ var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "backButton");
180153 mouseClick(backButton, 0, 0);
181154
182155 // Check temp scope is gone
183− var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem");
184− tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope == null; }, true);
185− tryCompare(scopesOverviewTempScopeItem, "enabled", false);
186−
187− // Press on done
188− var scopesOverviewDoneButton = findChild(scopesOverview, "scopesOverviewDoneButton");
189− mouseClick(scopesOverviewDoneButton, 0, 0);
190−
191− // Check the dash overview is gone
192− tryCompare(overviewController, "progress", 0);
156+ tryCompare(dashTempScopeItem, "x", dash.width);
157+ tryCompare(dashTempScopeItem, "visible", false);
193158
194159 // Original list is still on 0
195160 var dashContentList = findChild(dash, "dashContentList");
196161 compare(dashContentList.currentIndex, 0);
197162 }
198163
199− function test_temp_scope_dash_overview_all_search_temp_scope_favorite_from_all() {
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);
205−
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;
212− return false;
213− }, true);
214− var card2 = findChild(dashCategory2, "delegate2");
215− waitForRendering(card2);
216− mouseClick(card2, card2.width / 2, card2.height / 2);
217−
218− // Wait for temp scope to be there
219− var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
220− tryCompare(dashTempScopeItem, "x", 0);
221−
222− // Show the overview
223− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
224− var overviewController = findInvisibleChild(dash, "overviewController");
225− tryCompare(overviewController, "progress", 1);
226−
227− // Make sure tab is where it should
228− var scopesOverview = findChild(dash, "scopesOverview");
229− compare(scopesOverview.currentTab, 1);
164+ function test_manage_dash_search_temp_scope() {
165+ // Show the manage dash
166+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
167+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
168+ tryCompare(bottomEdgeController, "progress", 1);
230169
231170 // Do a search
232− var scopesOverviewPageHeader = findChild(scopesOverview, "scopesOverviewPageHeader");
233− var searchButton = findChild(scopesOverviewPageHeader, "search_header_button");
171+ var scopesList = findChild(dash, "scopesList");
172+ var scopesListPageHeader = findChild(scopesList, "pageHeader");
173+ var searchButton = findChild(scopesListPageHeader, "search_header_button");
234174 mouseClick(searchButton, 0, 0);
235175
236176 // Type something
237177 keyClick(Qt.Key_H);
238178
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);
244−
245179 // Click on a temp scope in the search
246− tryCompareFunction( function() {
247− return findChild(findChild(searchResultsViewer, "dashCategorysearchA"), "delegate2") != null;
248− }, true);
249− var cardTempScope = findChild(findChild(searchResultsViewer, "dashCategorysearchA"), "delegate2");
250− verify(cardTempScope, "Could not find delegate2");
180+ tryCompareFunction( function() { return findChild(scopesList, "scopesListCategorysearchA") != null; }, true);
181+ var dashCategorysearchA = findChild(scopesList, "scopesListCategorysearchA");
182+ tryCompareFunction( function() { return findChild(dashCategorysearchA, "delegate2") != null; }, true);
183+ var cardTempScope = findChild(dashCategorysearchA, "delegate2");
251184
252185 waitForRendering(cardTempScope);
253186 mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2);
@@ -257,29 +190,24 @@ Item {
257190 compare(overviewDragHandle.enabled, false);
258191
259192 // Check temp scope is there
260− var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem");
261− tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope != null; }, true);
262− tryCompare(scopesOverviewTempScopeItem, "enabled", true);
193+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
194+ tryCompare(dashTempScopeItem, "x", 0);
195+ tryCompare(dashTempScopeItem, "visible", true);
196+
197+ // Check the manage dash is gone
198+ tryCompare(bottomEdgeController, "progress", 0);
263199
264200 // Go back
265− var scopesOverviewTempScopeItemHeader = findChild(scopesOverviewTempScopeItem, "scopePageHeader");
266− var backButton = findChild(findChild(scopesOverviewTempScopeItemHeader, "innerPageHeader"), "backButton");
201+ var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
202+ var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "backButton");
267203 mouseClick(backButton, 0, 0);
268204
269205 // Check temp scope is gone
270− var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem");
271− tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope == null; }, true);
272− tryCompare(scopesOverviewTempScopeItem, "enabled", false);
273−
274− // Press on a favorite
275− var dashCategorysearchB = findChild(searchResultsViewer, "dashCategorysearchB");
276− var cardFavSearch = findChild(dashCategorysearchB, "delegate3");
277− mouseClick(cardFavSearch, 0, 0);
206+ tryCompare(dashTempScopeItem, "x", dash.width);
207+ tryCompare(dashTempScopeItem, "visible", false);
278208
279− // Check the dash overview is gone
280− tryCompare(overviewController, "progress", 0);
281−
282− // Original list went to the favorite
209+ // Original list is still on 0
210+ var dashContentList = findChild(dash, "dashContentList");
283211 compare(dashContentList.currentIndex, 0);
284212 }
285213