Changeset 87796 in webkit
- Timestamp:
- Jun 1, 2011 5:16:09 AM (13 years ago)
- Location:
- trunk/Source/WebKit/qt
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/qt/ChangeLog
r87767 r87796 1 2011-06-01 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 3 Reviewed by Tor Arne Vestbø. 4 5 [Qt] Rewrite tst_QDeclarativeWebView::multipleWindows() to not depend on Grid internals 6 https://bugs.webkit.org/show_bug.cgi?id=61739 7 8 The skipped test was imported from Qt source repository, and used private headers 9 to peek in the QML Grid element. This patch changes the QML used to expose the 10 information we want to test: number of pages opened and the first page opened. 11 12 * tests/qdeclarativewebview/resources/newwindows.html: 13 Added <body> tags. We have no reason to not use them in the test. 14 15 * tests/qdeclarativewebview/resources/newwindows.qml: 16 Moved the timer out of the page component, used anchors for setting webview size, 17 changed the way we count pages opened. Also changed coding style a bit. 18 19 * tests/qdeclarativewebview/tst_qdeclarativewebview.cpp: 20 (tst_QDeclarativeWebView::multipleWindows): 21 We now look for properties with the information we want in the rootItem: pagesOpened and 22 firstPageOpened. 23 1 24 2011-05-31 Rafael Brandao <rafael.lobo@openbossa.org> 2 25 -
trunk/Source/WebKit/qt/tests/qdeclarativewebview/resources/newwindows.html
r84100 r87796 1 <!DOCTYPE html> 1 2 <html> 2 3 <head> … … 12 13 </script> 13 14 </head> 15 <body> 14 16 <h1>Multiple windows...</h1> 15 17 16 18 <a id=thelink target="_blank" href="newwindows.html">Popup!</a> 19 </body> 20 </html> -
trunk/Source/WebKit/qt/tests/qdeclarativewebview/resources/newwindows.qml
r84100 r87796 8 8 id: pages 9 9 height: 300; width: 600 10 property int total: 0 10 property int pagesOpened: 0 11 property Item firstPageOpened: null 11 12 12 13 Component { 13 14 id: webViewPage 14 15 Rectangle { 15 width: webView.width 16 height: webView.height 17 border.color: "gray" 16 id: thisPage 17 width: 150 18 height: 150 19 property WebView webView: wv 18 20 19 21 WebView { 20 id: w ebView21 width: 150 // force predictable for test22 id: wv 23 anchors.fill: parent 22 24 newWindowComponent: webViewPage 23 25 newWindowParent: pages 24 26 url: "newwindows.html" 25 Timer { 26 interval: 10; running: total<4; repeat: false; 27 onTriggered: { if (webView.status==WebView.Ready) { total++; webView.evaluateJavaScript("clickTheLink()") } } 27 Component.onCompleted: { 28 if (pagesOpened == 1) { 29 pages.firstPageOpened = thisPage; 30 } 28 31 } 29 32 } … … 31 34 } 32 35 33 Loader { sourceComponent: webViewPage } 36 Loader { 37 id: originalPage 38 sourceComponent: webViewPage 39 property bool ready: status == Loader.Ready && item.webView.status == WebView.Ready 40 } 41 42 Timer { 43 interval: 10 44 running: originalPage.ready && pagesOpened < 4 45 repeat: true 46 onTriggered: { 47 pagesOpened++; 48 originalPage.item.webView.evaluateJavaScript("clickTheLink()"); 49 } 50 } 34 51 } -
trunk/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp
r86952 r87796 273 273 void tst_QDeclarativeWebView::multipleWindows() 274 274 { 275 QSKIP("Rework this test to not depend on QDeclarativeGrid", SkipAll);276 275 QDeclarativeEngine engine; 277 276 QDeclarativeComponent component(&engine, QUrl("qrc:///resources/newwindows.qml")); 278 277 checkNoErrors(component); 279 278 280 // QDeclarativeGrid *grid = qobject_cast<QDeclarativeGrid*>(component.create()); 281 // QVERIFY(grid != 0); 282 // QTRY_COMPARE(grid->children().count(), 2+4); // Component, Loader (with 1 WebView), 4 new-window WebViews 283 // QDeclarativeItem* popup = qobject_cast<QDeclarativeItem*>(grid->children().at(2)); // first popup after Component and Loader. 284 // QVERIFY(popup != 0); 285 // QTRY_COMPARE(popup->x(), 150.0); 279 QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(component.create()); 280 QVERIFY(rootItem); 281 282 QTRY_COMPARE(rootItem->property("pagesOpened").toInt(), 4); 283 284 QDeclarativeProperty prop(rootItem, "firstPageOpened"); 285 QObject* firstPageOpened = qvariant_cast<QObject*>(prop.read()); 286 QVERIFY(firstPageOpened); 287 288 QDeclarativeProperty xProp(firstPageOpened, "x"); 289 QTRY_COMPARE(xProp.read().toReal(), qreal(150.0)); 286 290 } 287 291
Note: See TracChangeset
for help on using the changeset viewer.