Source/WebKit/qt/ChangeLog

 12011-06-16 Rafael Brandao <rafael.lobo@openbossa.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 [Qt] Fix tst_QDeclarativeWebView::basicProperties() and historyNav() autotests
 6 https://bugs.webkit.org/show_bug.cgi?id=61042
 7
 8 This test had no guarantee that the icon would load before icon checks.
 9
 10 * tests/qdeclarativewebview/tst_qdeclarativewebview.cpp:
 11 (tst_QDeclarativeWebView::basicProperties):
 12 (tst_QDeclarativeWebView::historyNav):
 13
1142011-06-12 Adam Barth <abarth@webkit.org>
215
316 Reviewed by Alexey Proskuryakov.

Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp

@@void tst_QDeclarativeWebView::cleanupTestCase()
9292
9393void tst_QDeclarativeWebView::basicProperties()
9494{
 95 QWebSettings::setIconDatabasePath(tmpDir());
 96 QWebSettings::enablePersistentStorage(tmpDir());
9597 QDeclarativeEngine engine;
9698 QDeclarativeComponent component(&engine, QUrl("qrc:///resources/basic.qml"));
9799 checkNoErrors(component);
98  QWebSettings::enablePersistentStorage(tmpDir());
99100
100101 QObject* wv = component.create();
101102 QVERIFY(wv);
 103 waitForSignal(wv, SIGNAL(iconChanged()), 15000);
102104 QTRY_COMPARE(wv->property("progress").toDouble(), 1.0);
103105 QCOMPARE(wv->property("title").toString(), QLatin1String("Basic"));
104  QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=61042", Continue);
105106 QTRY_COMPARE(qvariant_cast<QPixmap>(wv->property("icon")).width(), 48);
106107 QEXPECT_FAIL("", "'icon' property isn't working", Continue);
107108 QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap("qrc:///resources/basic.png"));

@@void tst_QDeclarativeWebView::elementAreaAt()
159160
160161void tst_QDeclarativeWebView::historyNav()
161162{
 163 QWebSettings::setIconDatabasePath(tmpDir());
 164 QWebSettings::enablePersistentStorage(tmpDir());
162165 QDeclarativeEngine engine;
163166 QDeclarativeComponent component(&engine, QUrl("qrc:///resources/basic.qml"));
164167 checkNoErrors(component);
165  QWebSettings::enablePersistentStorage(tmpDir());
166168
167169 QObject* wv = component.create();
168170 QVERIFY(wv);
 171 waitForSignal(wv, SIGNAL(iconChanged()), 15000);
169172
170173 QAction* reloadAction = wv->property("reload").value<QAction*>();
171174 QVERIFY(reloadAction);

@@void tst_QDeclarativeWebView::historyNav()
179182 for (int i = 1; i <= 2; ++i) {
180183 QTRY_COMPARE(wv->property("progress").toDouble(), 1.0);
181184 QCOMPARE(wv->property("title").toString(), QLatin1String("Basic"));
182  QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=61042", Continue);
183  QTRY_COMPARE(qvariant_cast<QPixmap>(wv->property("icon")).width(), 48);
 185 QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")).width(), 48);
184186 QEXPECT_FAIL("", "'icon' property isn't working", Continue);
185187 QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap("qrc:///data/basic.png"));
186188 QCOMPARE(wv->property("statusText").toString(), QLatin1String("status here"));

@@void tst_QDeclarativeWebView::historyNav()
197199 }
198200
199201 wv->setProperty("url", QUrl("qrc:///resources/forward.html"));
 202 waitForSignal(wv, SIGNAL(iconChanged()), 15000);
200203 QTRY_COMPARE(wv->property("progress").toDouble(), 1.0);
201204 QCOMPARE(wv->property("title").toString(), QLatin1String("Forward"));
202  QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=61042", Continue);
203  QTRY_COMPARE(qvariant_cast<QPixmap>(wv->property("icon")).width(), 32);
 205 QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")).width(), 32);
204206 QEXPECT_FAIL("", "'icon' property isn't working", Continue);
205207 QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap("qrc:///resources/forward.png"));
206208 QCOMPARE(strippedHtml(fileContents(":/resources/forward.html")), strippedHtml(wv->property("html").toString()));