Changeset 53614 in webkit
- Timestamp:
- Jan 21, 2010 1:02:23 AM (14 years ago)
- Location:
- trunk/WebKit/qt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/ChangeLog
r53613 r53614 1 2010-01-21 Benjamin Poulain <benjamin.poulain@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] Improve the autotests of QtWebkit 6 https://bugs.webkit.org/show_bug.cgi?id=32216 7 8 Remove qWait() of the test when possible. 9 10 * tests/qwebpage/tst_qwebpage.cpp: 11 (tst_QWebPage::loadFinished): 12 (tst_QWebPage::database): 13 (tst_QWebPage::testEnablePersistentStorage): 14 (tst_QWebPage::errorPageExtension): 15 (tst_QWebPage::screenshot): 16 1 17 2010-01-21 Simon Hausmann <simon.hausmann@nokia.com> 2 18 -
trunk/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r53267 r53614 19 19 */ 20 20 21 21 #include "../util.h" 22 #include <QDir> 23 #include <QGraphicsWidget> 24 #include <QLineEdit> 25 #include <QMenu> 26 #include <QPushButton> 22 27 #include <QtTest/QtTest> 23 24 28 #include <qgraphicsscene.h> 25 29 #include <qgraphicsview.h> 26 30 #include <qgraphicswebview.h> 31 #include <qnetworkrequest.h> 32 #include <qwebdatabase.h> 27 33 #include <qwebelement.h> 28 #include <qwebpage.h>29 #include <qwidget.h>30 #include <QGraphicsWidget>31 #include <qwebview.h>32 34 #include <qwebframe.h> 33 35 #include <qwebhistory.h> 34 #include <qnetworkrequest.h> 35 #include <QDebug> 36 #include <QLineEdit> 37 #include <QMenu> 36 #include <qwebpage.h> 38 37 #include <qwebsecurityorigin.h> 39 #include <qwebdatabase.h> 40 #include <QPushButton> 41 #include <QDir> 42 #include "../util.h" 38 #include <qwebview.h> 43 39 44 40 class EventSpy : public QObject, public QList<QEvent::Type> … … 227 223 QTRY_COMPARE(spyLoadFinished.count(), 1); 228 224 229 QTest::qWait(3000); 230 231 QVERIFY(spyLoadStarted.count() > 1); 232 QVERIFY(spyLoadFinished.count() > 1); 225 QTRY_VERIFY(spyLoadStarted.count() > 1); 226 QTRY_VERIFY(spyLoadFinished.count() > 1); 233 227 234 228 spyLoadFinished.clear(); … … 477 471 QWebDatabase::removeAllDatabases(); 478 472 QVERIFY(!origin.databases().size()); 479 QTest::qWait(1000);480 473 } 481 474 … … 1557 1550 QWebSettings::enablePersistentStorage(); 1558 1551 1559 // Give it some time to initialize - icon database needs it 1560 QTest::qWait(1000); 1561 1562 QCOMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), true); 1563 QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), true); 1564 QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), true); 1565 1566 QVERIFY(!webPage.settings()->offlineStoragePath().isEmpty()); 1567 QVERIFY(!webPage.settings()->offlineWebApplicationCachePath().isEmpty()); 1568 QVERIFY(!webPage.settings()->iconDatabasePath().isEmpty()); 1552 1553 QTRY_COMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), true); 1554 QTRY_COMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), true); 1555 QTRY_COMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), true); 1556 1557 QTRY_VERIFY(!webPage.settings()->offlineStoragePath().isEmpty()); 1558 QTRY_VERIFY(!webPage.settings()->offlineWebApplicationCachePath().isEmpty()); 1559 QTRY_VERIFY(!webPage.settings()->iconDatabasePath().isEmpty()); 1569 1560 } 1570 1561 … … 1634 1625 1635 1626 page->triggerAction(QWebPage::Back); 1636 QTest::qWait(2000); 1637 QCOMPARE(page->history()->canGoBack(), false); 1638 QCOMPARE(page->history()->canGoForward(), true); 1627 QTRY_COMPARE(page->history()->canGoBack(), false); 1628 QTRY_COMPARE(page->history()->canGoForward(), true); 1639 1629 1640 1630 page->triggerAction(QWebPage::Forward); 1641 QTest::qWait(2000); 1642 QCOMPARE(page->history()->canGoBack(), true); 1643 QCOMPARE(page->history()->canGoForward(), false); 1631 QTRY_COMPARE(page->history()->canGoBack(), true); 1632 QTRY_COMPARE(page->history()->canGoForward(), false); 1644 1633 1645 1634 page->triggerAction(QWebPage::Back); 1646 QTest::qWait(2000); 1647 QCOMPARE(page->history()->canGoBack(), false); 1648 QCOMPARE(page->history()->canGoForward(), true); 1649 QCOMPARE(page->history()->currentItem().url(), QUrl("data:text/html,foo")); 1635 QTRY_COMPARE(page->history()->canGoBack(), false); 1636 QTRY_COMPARE(page->history()->canGoForward(), true); 1637 QTRY_COMPARE(page->history()->currentItem().url(), QUrl("data:text/html,foo")); 1650 1638 1651 1639 m_view->setPage(0); … … 1733 1721 QWebFrame* mainFrame = page->mainFrame(); 1734 1722 mainFrame->setHtml(html, QUrl::fromLocalFile(TESTS_SOURCE_DIR)); 1735 if (html.contains("</embed>")) { 1736 // some reasonable time for the PluginStream to feed test.swf to flash and start painting 1737 QTest::qWait(2000); 1738 } 1723 ::waitForSignal(mainFrame, SIGNAL(loadFinished(bool)), 2000); 1739 1724 1740 1725 // take screenshot without a view
Note: See TracChangeset
for help on using the changeset viewer.