aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-10-26 16:56:37 +0200
committerChristian Tismer <tismer@stackless.com>2017-10-27 00:48:08 +0000
commit8ff047b26dd7e928bd35c519fb9e18db4d1b9a94 (patch)
tree382c41292ac478cf0c8dfbd46c1ee0f16c62b4e6
parentc7f9793ff660ed608474d0cab3b31054dbebb458 (diff)
Stabilize QtQml/bug_847.py
Add more checks for QML loading. Wait until the window is exposed until starting the safety timer and increase its interval. Task-number: PYSIDE-431 Change-Id: I6225f2357d9576be15c6134d26982939698a9984 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rwxr-xr-xsources/pyside2/tests/QtQml/bug_847.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/sources/pyside2/tests/QtQml/bug_847.py b/sources/pyside2/tests/QtQml/bug_847.py
index e46888d1..e69bd201 100755
--- a/sources/pyside2/tests/QtQml/bug_847.py
+++ b/sources/pyside2/tests/QtQml/bug_847.py
@@ -66,11 +66,18 @@ class TestQML(UsesQApplication):
# Connect first, then set the property.
view.called.connect(self.done)
view.setSource(QUrl.fromLocalFile(adjust_filename('bug_847.qml', __file__)))
+ while view.status() == QQuickView.Loading:
+ self.app.processEvents()
+ self.assertEqual(view.status(), QQuickView.Ready)
+ self.assertTrue(view.rootObject())
view.rootObject().setProperty('pythonObject', view)
view.show()
+ while not view.isExposed():
+ self.app.processEvents()
+
# Essentially a timeout in case method invocation fails.
- QTimer.singleShot(2000, QCoreApplication.instance().quit)
+ QTimer.singleShot(30000, QCoreApplication.instance().quit)
self.app.exec_()
self.assertTrue(self._sucess)