From ea463aa2cf8986664aeb9c1f9246aa32c4abbfff Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 24 Jan 2019 11:23:48 +0100 Subject: ScrollView Tests: Allow for delayed update when loading new data The ScrollView can render multiple times before the content is complete. Change-Id: I32513a96e51c4d91e53daa6204821a95d9cb1d52 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_scrollview.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_scrollview.qml b/tests/auto/controls/data/tst_scrollview.qml index d3bfac4b6..95aa6e980 100644 --- a/tests/auto/controls/data/tst_scrollview.qml +++ b/tests/auto/controls/data/tst_scrollview.qml @@ -197,8 +197,12 @@ TestCase { mouseRelease(scrollView, scrollView.width - 2, 8 + 16) waitForRendering(scrollView) - verify(Math.round(scrollView.flickableItem.contentHeight) > 60 * 20) - verify(Math.round(scrollView.flickableItem.contentY) < -(60 * 20)) + tryVerify( + function() { return Math.round(scrollView.flickableItem.contentHeight) > 60 * 20 }, + 50, "contentHeight did not adjust to new data.") + tryVerify( + function() { return Math.round(scrollView.flickableItem.contentY) < -(60 * 20) }, + 50, "contentY did not adjust to new data.") scrollView.destroy() } -- cgit v1.2.3