diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativewebview')
-rw-r--r-- | tests/auto/declarative/qdeclarativewebview/data/newwindows.qml | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativewebview/tst_qdeclarativewebview.cpp | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml b/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml index 4d9df43..5f9f757 100644 --- a/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml +++ b/tests/auto/declarative/qdeclarativewebview/data/newwindows.qml @@ -23,8 +23,8 @@ Grid { newWindowParent: pages url: "newwindows.html" Timer { - interval: 10; running: webView.status==WebView.Ready && total<4; repeat: false; - onTriggered: {total++; webView.evaluateJavaScript("clickTheLink()")} + interval: 10; running: total<4; repeat: false; + onTriggered: { if (webView.status==WebView.Ready) { total++; webView.evaluateJavaScript("clickTheLink()") } } } } } diff --git a/tests/auto/declarative/qdeclarativewebview/tst_qdeclarativewebview.cpp b/tests/auto/declarative/qdeclarativewebview/tst_qdeclarativewebview.cpp index b63e14b..ce389f3 100644 --- a/tests/auto/declarative/qdeclarativewebview/tst_qdeclarativewebview.cpp +++ b/tests/auto/declarative/qdeclarativewebview/tst_qdeclarativewebview.cpp @@ -122,8 +122,7 @@ void tst_qdeclarativewebview::cleanupTestCase() void tst_qdeclarativewebview::checkNoErrors(const QDeclarativeComponent& component) { // Wait until the component is ready - QTRY_VERIFY(component.isReady()); - + QTRY_VERIFY(component.isReady() || component.isError()); if (component.isError()) { QList<QDeclarativeError> errors = component.errors(); @@ -313,8 +312,8 @@ void tst_qdeclarativewebview::multipleWindows() QDeclarativeGrid *grid = qobject_cast<QDeclarativeGrid*>(component.create()); QVERIFY(grid != 0); - QTRY_COMPARE(grid->children().count(), 2+5); // Component, Loader, 5 WebViews - QDeclarativeItem* popup = qobject_cast<QDeclarativeItem*>(grid->children().at(3)); // first popup after Component, Loaded, original. + QTRY_COMPARE(grid->children().count(), 2+4); // Component, Loader (with 1 WebView), 4 new-window WebViews + QDeclarativeItem* popup = qobject_cast<QDeclarativeItem*>(grid->children().at(2)); // first popup after Component and Loader. QVERIFY(popup != 0); QTRY_COMPARE(popup->x(), 150.0); } |