on xenial help sign in
Move common waiting to the top
commit0c6b0c908a008733d46cfd55373e44ae00f64d32 authorAlbert Astals <albert.astals@canonical.com> dateTue 23 Sep 2014, 15:19 (12 years ago) parent4a12825
1 file changed+10−37
tests/qmltests/Dash/tst_Dash.qml+10−37
tests/qmltests/Dash/tst_Dash.qml+10−37
@@ -55,6 +55,11 @@ Item {
5555 scopes.load();
5656 tryCompare(dashContentList, "currentIndex", 0);
5757 tryCompare(dashContentList, "count", 6);
58+ tryCompare(scopes, "loaded", true);
59+ tryCompareFunction(function() {
60+ var mockScope1Loader = findChild(dash, "MockScope1 loader");
61+ return mockScope1Loader && mockScope1Loader.item != null; },
62+ true, 15000);
5863 }
5964
6065 function get_scope_data() {
@@ -92,15 +97,6 @@ Item {
9297 }
9398
9499 function test_dash_overview_show_select_same_favorite() {
95− // Wait for stuff to be loaded
96− tryCompare(scopes, "loaded", true);
97− var dashContentList = findChild(dash, "dashContentList");
98− tryCompare(dashContentList, "count", 6);
99− tryCompareFunction(function() {
100− var mockScope1Loader = findChild(dash, "MockScope1 loader");
101− return mockScope1Loader && mockScope1Loader.item != null; },
102− true, 15000);
103−
104100 // Show the overview
105101 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
106102 var overviewController = findInvisibleChild(dash, "overviewController");
@@ -121,18 +117,12 @@ Item {
121117
122118 // Make sure animation went back
123119 tryCompare(overviewController, "progress", 0);
120+
121+ var dashContentList = findChild(dash, "dashContentList");
124122 compare(dashContentList.currentIndex, 0);
125123 }
126124
127125 function test_dash_overview_show_select_different_favorite() {
128− // Wait for stuff to be loaded
129− tryCompare(scopes, "loaded", true);
130− var dashContentList = findChild(dash, "dashContentList");
131− tryCompare(dashContentList, "count", 6);
132− tryCompareFunction(function() { return findChild(dash, "MockScope1 loader") != null; }, true, 15000);
133− var mockScope1Loader = findChild(dash, "MockScope1 loader");
134− tryCompare(mockScope1Loader, "status", Loader.Ready);
135−
136126 // Show the overview
137127 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
138128 var overviewController = findInvisibleChild(dash, "overviewController");
@@ -153,19 +143,11 @@ Item {
153143
154144 // Make sure animation went back
155145 tryCompare(overviewController, "progress", 0);
146+ var dashContentList = findChild(dash, "dashContentList");
156147 compare(dashContentList.currentIndex, 1);
157148 }
158149
159150 function test_dash_overview_all_temp_scope_done_from_all() {
160− // Wait for stuff to be loaded
161− tryCompare(scopes, "loaded", true);
162− var dashContentList = findChild(dash, "dashContentList");
163− tryCompare(dashContentList, "count", 6);
164− tryCompareFunction(function() {
165− var mockScope1Loader = findChild(dash, "MockScope1 loader");
166− return mockScope1Loader && mockScope1Loader.item != null; },
167− true, 15000);
168−
169151 // Show the overview
170152 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
171153 var overviewController = findInvisibleChild(dash, "overviewController");
@@ -227,20 +209,13 @@ Item {
227209 tryCompare(overviewController, "progress", 0);
228210
229211 // Original list is still on 0
212+ var dashContentList = findChild(dash, "dashContentList");
230213 compare(dashContentList.currentIndex, 0);
231214 }
232215
233216 function test_temp_scope_dash_overview_all_search_temp_scope_favorite_from_all() {
234− // Wait for stuff to be loaded
235− tryCompare(scopes, "loaded", true);
236− var dashContentList = findChild(dash, "dashContentList");
237− tryCompare(dashContentList, "count", 6);
238− tryCompareFunction(function() {
239− var mockScope1Loader = findChild(dash, "MockScope1 loader");
240− return mockScope1Loader && mockScope1Loader.item != null; },
241− true, 15000);
242−
243217 // Swipe right to Apps scope
218+ var dashContentList = findChild(dash, "dashContentList");
244219 touchFlick(dash, dash.width - 1, units.gu(1), dash.width - units.gu(10), units.gu(1));
245220 tryCompare(dashContentList, "contentX", dashContentList.width);
246221 tryCompare(dashContentList, "currentIndex", 1);
@@ -339,8 +314,6 @@ Item {
339314 }
340315
341316 function test_processing_indicator() {
342− tryCompare(scopes, "loaded", true);
343−
344317 var processingIndicator = findChild(dash, "processingIndicator");
345318 verify(processingIndicator, "Can't find the processing indicator.");
346319