Changeset 99235 in webkit


Ignore:
Timestamp:
Nov 3, 2011 1:37:20 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Fix tst_QDeclarativeWebView::basicProperties() and historyNav() autotests
https://bugs.webkit.org/show_bug.cgi?id=61042

Patch by Rafael Brandao <rafael.lobo@openbossa.org> on 2011-11-03
Reviewed by Simon Hausmann.

At some points we didn't have any guarantee that a favicon has been loaded, so now
it stops to wait for the IconChanged signal. It also had some file paths in wrong format,
making some files to not be resolved and comparing meaningless bitmaps.

  • tests/qdeclarativewebview/tst_qdeclarativewebview.cpp:

(tst_QDeclarativeWebView::initTestCase):
(tst_QDeclarativeWebView::basicProperties):
(tst_QDeclarativeWebView::historyNav):

Location:
trunk/Source/WebKit/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/qt/ChangeLog

    r99202 r99235  
     12011-11-03  Rafael Brandao  <rafael.lobo@openbossa.org>
     2
     3        Fix tst_QDeclarativeWebView::basicProperties() and historyNav() autotests
     4        https://bugs.webkit.org/show_bug.cgi?id=61042
     5
     6        Reviewed by Simon Hausmann.
     7       
     8        At some points we didn't have any guarantee that a favicon has been loaded, so now
     9        it stops to wait for the IconChanged signal. It also had some file paths in wrong format,
     10        making some files to not be resolved and comparing meaningless bitmaps.
     11
     12        * tests/qdeclarativewebview/tst_qdeclarativewebview.cpp:
     13        (tst_QDeclarativeWebView::initTestCase):
     14        (tst_QDeclarativeWebView::basicProperties):
     15        (tst_QDeclarativeWebView::historyNav):
     16
    1172011-11-03  Simon Hausmann  <simon.hausmann@nokia.com>
    218
  • trunk/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp

    r95901 r99235  
    2727
    2828private slots:
     29    void initTestCase();
    2930    void cleanupTestCase();
    3031
     
    8990}
    9091
     92void tst_QDeclarativeWebView::initTestCase()
     93{
     94    QWebSettings::setIconDatabasePath(tmpDir());
     95    QWebSettings::enablePersistentStorage(tmpDir());
     96}
     97
    9198void tst_QDeclarativeWebView::cleanupTestCase()
    9299{
     
    103110    QObject* wv = component.create();
    104111    QVERIFY(wv);
     112    waitForSignal(wv, SIGNAL(iconChanged()));
    105113    QTRY_COMPARE(wv->property("progress").toDouble(), 1.0);
    106114    QCOMPARE(wv->property("title").toString(), QLatin1String("Basic"));
    107115    QTRY_COMPARE(qvariant_cast<QPixmap>(wv->property("icon")).width(), 48);
    108     QEXPECT_FAIL("", "'icon' property isn't working", Continue);
    109     QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap("qrc:///resources/basic.png"));
     116    QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap(":/resources/basic.png"));
    110117    QCOMPARE(wv->property("statusText").toString(), QLatin1String("status here"));
    111118    QCOMPARE(strippedHtml(fileContents(":/resources/basic.html")), strippedHtml(wv->property("html").toString()));
     
    169176    QObject* wv = component.create();
    170177    QVERIFY(wv);
     178    waitForSignal(wv, SIGNAL(iconChanged()));
    171179
    172180    QAction* reloadAction = wv->property("reload").value<QAction*>();
     
    183191        QCOMPARE(wv->property("title").toString(), QLatin1String("Basic"));
    184192        QTRY_COMPARE(qvariant_cast<QPixmap>(wv->property("icon")).width(), 48);
    185         QEXPECT_FAIL("", "'icon' property isn't working", Continue);
    186         QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap("qrc:///data/basic.png"));
     193        QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap(":/resources/basic.png"));
    187194        QCOMPARE(wv->property("statusText").toString(), QLatin1String("status here"));
    188195        QCOMPARE(strippedHtml(fileContents(":/resources/basic.html")), strippedHtml(wv->property("html").toString()));
     
    196203        QVERIFY(!stopAction->isEnabled());
    197204        reloadAction->trigger();
     205        waitForSignal(wv, SIGNAL(iconChanged()));
    198206    }
    199207
    200208    wv->setProperty("url", QUrl("qrc:///resources/forward.html"));
     209    waitForSignal(wv, SIGNAL(iconChanged()));
    201210    QTRY_COMPARE(wv->property("progress").toDouble(), 1.0);
    202211    QCOMPARE(wv->property("title").toString(), QLatin1String("Forward"));
    203212    QTRY_COMPARE(qvariant_cast<QPixmap>(wv->property("icon")).width(), 32);
    204     QEXPECT_FAIL("", "'icon' property isn't working", Continue);
    205     QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap("qrc:///resources/forward.png"));
     213    QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap(":/resources/forward.png"));
    206214    QCOMPARE(strippedHtml(fileContents(":/resources/forward.html")), strippedHtml(wv->property("html").toString()));
    207215    QCOMPARE(wv->property("url").toUrl(), QUrl("qrc:///resources/forward.html"));
     
    217225
    218226    backAction->trigger();
     227    waitForSignal(wv, SIGNAL(loadFinished()));
    219228
    220229    QTRY_COMPARE(wv->property("progress").toDouble(), 1.0);
Note: See TracChangeset for help on using the changeset viewer.