From 81b876b7177cf0d55b7c009342e501bfa900175c Mon Sep 17 00:00:00 2001 From: Daiwei Li Date: Fri, 23 Jan 2015 14:42:33 -0800 Subject: qquicktest: Wait for the view to finish loading Tests can be skipped if the view is still loading by the time we get to the end of the loop. There is a case where the window is active but the QML hasn't been loaded. Change-Id: I4e8346ee547653810458d042925d673748c1fec8 Reviewed-by: Caroline Chao Reviewed-by: Friedemann Kleint Reviewed-by: J-P Nurmi --- src/qmltest/quicktest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/qmltest/quicktest.cpp') diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index bef20c6464..0c8bfab1fa 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -362,6 +362,10 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD } view->show(); view->requestActivate(); + + while (view->status() == QQuickView::Loading) + QTest::qWait(10); + QTest::qWaitForWindowActive(view); if (view->isExposed()) QTestRootObject::instance()->setWindowShown(true); -- cgit v1.2.3