From 8e872ed96a77a1bef37a5612e1825bd045447029 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Fri, 12 Feb 2010 09:55:56 +1000 Subject: Fixed race condition in tst_qmlgraphicswebview::multipleWindows This timer must not be started until the web view has finished loading. --- tests/auto/declarative/qmlgraphicswebview/data/newwindows.qml | 2 +- tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/declarative/qmlgraphicswebview/data/newwindows.qml b/tests/auto/declarative/qmlgraphicswebview/data/newwindows.qml index 9d13715..b8524af 100644 --- a/tests/auto/declarative/qmlgraphicswebview/data/newwindows.qml +++ b/tests/auto/declarative/qmlgraphicswebview/data/newwindows.qml @@ -21,7 +21,7 @@ Grid { newWindowParent: pages url: "newwindows.html" Timer { - interval: 10; running: total<4; repeat: false; + interval: 10; running: webView.status==WebView.Ready && total<4; repeat: false; onTriggered: {total++; webView.evaluateJavaScript("clickTheLink()")} } } diff --git a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp index c244030..6996a6c 100644 --- a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp +++ b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp @@ -114,6 +114,10 @@ void tst_qmlgraphicswebview::cleanupTestCase() void tst_qmlgraphicswebview::checkNoErrors(const QmlComponent& component) { + // Wait until the component is ready + QTRY_VERIFY(component.isReady()); + + if (component.isError()) { QList errors = component.errors(); for (int ii = 0; ii < errors.count(); ++ii) { -- cgit v0.12