on xenial help sign in
Make waitForRendering with no item fail instead of crash

Approved by: Michał Sawicz, PS Jenkins bot

commit953086f2d284c1564f0a4e204d70b18cd0a36966 authorAlbert Astals <albert.astals@canonical.com> dateFri 9 Jan 2015, 10:40 (12 years ago) parent301be17e7c95e7
1 file changed+10
tests/utils/modules/Unity/Test/UnityTestCase.qml+10
tests/utils/modules/Unity/Test/UnityTestCase.qml+10
@@ -381,4 +381,14 @@ TestCase {
381381 }
382382 }
383383 }
384+
385+ // TODO This function can be removed altogether once we use Qt 5.5 which has the same feature
386+ function waitForRendering(item, timeout) {
387+ if (timeout === undefined)
388+ timeout = 5000;
389+ if (!item)
390+ qtest_fail("No item given to waitForRendering", 1);
391+ return qtest_results.waitForRendering(item, timeout);
392+ }
393+
384394}