on xenial help sign in
things are a bit slower to load now since we're asking for a bazillion of items to be on memory so give the tryCompareFunction some more time
commit4a12825557a64d2e30fd42c69983b068f145ee5b authorAlbert Astals <albert.astals@canonical.com> dateTue 23 Sep 2014, 12:27 (12 years ago) parent9fa938d
2 files changed+7−6
tests/qmltests/Dash/tst_Dash.qml+4−4 tests/utils/modules/Unity/Test/UnityTestCase.qml+3−2
tests/qmltests/Dash/tst_Dash.qml+4−4
@@ -99,7 +99,7 @@ Item {
9999 tryCompareFunction(function() {
100100 var mockScope1Loader = findChild(dash, "MockScope1 loader");
101101 return mockScope1Loader && mockScope1Loader.item != null; },
102− true);
102+ true, 15000);
103103
104104 // Show the overview
105105 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
@@ -129,7 +129,7 @@ Item {
129129 tryCompare(scopes, "loaded", true);
130130 var dashContentList = findChild(dash, "dashContentList");
131131 tryCompare(dashContentList, "count", 6);
132− tryCompareFunction(function() { return findChild(dash, "MockScope1 loader") != null; }, true);
132+ tryCompareFunction(function() { return findChild(dash, "MockScope1 loader") != null; }, true, 15000);
133133 var mockScope1Loader = findChild(dash, "MockScope1 loader");
134134 tryCompare(mockScope1Loader, "status", Loader.Ready);
135135
@@ -164,7 +164,7 @@ Item {
164164 tryCompareFunction(function() {
165165 var mockScope1Loader = findChild(dash, "MockScope1 loader");
166166 return mockScope1Loader && mockScope1Loader.item != null; },
167− true);
167+ true, 15000);
168168
169169 // Show the overview
170170 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
@@ -238,7 +238,7 @@ Item {
238238 tryCompareFunction(function() {
239239 var mockScope1Loader = findChild(dash, "MockScope1 loader");
240240 return mockScope1Loader && mockScope1Loader.item != null; },
241− true);
241+ true, 15000);
242242
243243 // Swipe right to Apps scope
244244 touchFlick(dash, dash.width - 1, units.gu(1), dash.width - units.gu(10), units.gu(1));
tests/utils/modules/Unity/Test/UnityTestCase.qml+3−2
@@ -178,9 +178,10 @@ TestCase {
178178 // Keeps executing a given parameter-less function until it returns the given
179179 // expected result or the timemout is reached (in which case a test failure
180180 // is generated)
181− function tryCompareFunction(func, expectedResult) {
181+ function tryCompareFunction(func, expectedResult, timeout) {
182182 var timeSpent = 0
183− var timeout = 5000
183+ if (timeout === undefined)
184+ timeout = 5000;
184185 var success = false
185186 var actualResult
186187 while (timeSpent < timeout && !success) {