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
4a12825Albert Astals
tests/qmltests/Dash/tst_Dash.qml+4−4
@@ -99,7 +99,7 @@ Item {
99 tryCompareFunction(function() {
99 tryCompareFunction(function() {
100 var mockScope1Loader = findChild(dash, "MockScope1 loader");
100 var mockScope1Loader = findChild(dash, "MockScope1 loader");
101 return mockScope1Loader && mockScope1Loader.item != null; },
101 return mockScope1Loader && mockScope1Loader.item != null; },
102− true);
102+ true, 15000);
103
103
104 // Show the overview
104 // Show the overview
105 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, dash.height - units.gu(18));
@@ -129,7 +129,7 @@ Item {
129 tryCompare(scopes, "loaded", true);
129 tryCompare(scopes, "loaded", true);
130 var dashContentList = findChild(dash, "dashContentList");
130 var dashContentList = findChild(dash, "dashContentList");
131 tryCompare(dashContentList, "count", 6);
131 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);
133 var mockScope1Loader = findChild(dash, "MockScope1 loader");
133 var mockScope1Loader = findChild(dash, "MockScope1 loader");
134 tryCompare(mockScope1Loader, "status", Loader.Ready);
134 tryCompare(mockScope1Loader, "status", Loader.Ready);
135
135
@@ -164,7 +164,7 @@ Item {
164 tryCompareFunction(function() {
164 tryCompareFunction(function() {
165 var mockScope1Loader = findChild(dash, "MockScope1 loader");
165 var mockScope1Loader = findChild(dash, "MockScope1 loader");
166 return mockScope1Loader && mockScope1Loader.item != null; },
166 return mockScope1Loader && mockScope1Loader.item != null; },
167− true);
167+ true, 15000);
168
168
169 // Show the overview
169 // Show the overview
170 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
170 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
@@ -238,7 +238,7 @@ Item {
238 tryCompareFunction(function() {
238 tryCompareFunction(function() {
239 var mockScope1Loader = findChild(dash, "MockScope1 loader");
239 var mockScope1Loader = findChild(dash, "MockScope1 loader");
240 return mockScope1Loader && mockScope1Loader.item != null; },
240 return mockScope1Loader && mockScope1Loader.item != null; },
241− true);
241+ true, 15000);
242
242
243 // Swipe right to Apps scope
243 // Swipe right to Apps scope
244 touchFlick(dash, dash.width - 1, units.gu(1), dash.width - units.gu(10), units.gu(1));
244 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 {
178 // Keeps executing a given parameter-less function until it returns the given
178 // Keeps executing a given parameter-less function until it returns the given
179 // expected result or the timemout is reached (in which case a test failure
179 // expected result or the timemout is reached (in which case a test failure
180 // is generated)
180 // is generated)
181− function tryCompareFunction(func, expectedResult) {
181+ function tryCompareFunction(func, expectedResult, timeout) {
182 var timeSpent = 0
182 var timeSpent = 0
183+ if (timeout === undefined)
183− var timeout = 5000
184+ timeout = 5000;
184 var success = false
185 var success = false
185 var actualResult
186 var actualResult
186 while (timeSpent < timeout && !success) {
187 while (timeSpent < timeout && !success) {