diff options
author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp | |
parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp')
-rw-r--r-- | Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp index 3c47d1c..bc1594a 100644 --- a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp +++ b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp @@ -590,6 +590,7 @@ public slots: void cleanup(); private slots: + void horizontalScrollAfterBack(); void getSetStaticProperty(); void getSetDynamicProperty(); void getSetChildren(); @@ -647,6 +648,8 @@ private slots: void setContent_data(); void setContent(); void setCacheLoadControlAttribute(); + void setUrlWithPendingLoads(); + void setUrlWithFragment(); private: QString evalJS(const QString&s) { @@ -3101,6 +3104,29 @@ void tst_QWebFrame::scrollbarsOff() QCOMPARE(mainFrame->documentElement().findAll("span").at(0).toPlainText(), QString("SUCCESS")); } +void tst_QWebFrame::horizontalScrollAfterBack() +{ + QWebView view; + QWebFrame* frame = view.page()->mainFrame(); + QSignalSpy loadSpy(view.page(), SIGNAL(loadFinished(bool))); + + view.page()->settings()->setMaximumPagesInCache(2); + frame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded); + frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAsNeeded); + + view.load(QUrl("qrc:/testiframe2.html")); + view.resize(200, 200); + QTRY_COMPARE(loadSpy.count(), 1); + QTRY_VERIFY((frame->scrollBarGeometry(Qt::Horizontal)).height()); + + view.load(QUrl("qrc:/testiframe.html")); + QTRY_COMPARE(loadSpy.count(), 2); + + view.page()->triggerAction(QWebPage::Back); + QTRY_COMPARE(loadSpy.count(), 3); + QTRY_VERIFY((frame->scrollBarGeometry(Qt::Horizontal)).height()); +} + void tst_QWebFrame::evaluateWillCauseRepaint() { QWebView view; @@ -3287,5 +3313,32 @@ void tst_QWebFrame::webElementSlotOnly() QCOMPARE(evalJS("myWebElementSlotObject.tagName"), QString("BODY")); } +void tst_QWebFrame::setUrlWithPendingLoads() +{ + QWebPage page; + page.mainFrame()->setHtml("<img src='dummy:'/>"); + page.mainFrame()->setUrl(QUrl("about:blank")); +} + +void tst_QWebFrame::setUrlWithFragment() +{ + QSKIP("Bug https://bugs.webkit.org/show_bug.cgi?id=32723", SkipAll); + + // Based on bug report https://bugs.webkit.org/show_bug.cgi?id=32723 + QWebPage page; + QSignalSpy spy(&page, SIGNAL(loadFinished(bool))); + + const QUrl url("qrc:/test1.html#"); + QVERIFY(!url.fragment().isNull()); + + page.mainFrame()->setUrl(url); + ::waitForSignal(&page, SIGNAL(loadFinished(bool))); + + QCOMPARE(spy.count(), 1); + QVERIFY(!page.mainFrame()->toPlainText().isEmpty()); + QCOMPARE(page.mainFrame()->requestedUrl(), url); + QCOMPARE(page.mainFrame()->url(), url); +} + QTEST_MAIN(tst_QWebFrame) #include "tst_qwebframe.moc" |