[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

tonikitoo at webkit.org tonikitoo at webkit.org
Thu Oct 29 20:43:45 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 46dbf674c761c9224f70a938f8cc7c270202b9b3
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 13 11:35:36 2009 +0000

    [Qt] Add some initial autotests for QWebPage's ErrorPageExtention
    https://bugs.webkit.org/show_bug.cgi?id=30296
    
    Patch by Antonio Gomes <tonikitoo at webkit.org> on 2009-10-13
    Reviewed by Simon Hausmann.
    
    * tests/qwebpage/tst_qwebpage.cpp:
    (ErrorPage::ErrorPage):
    (ErrorPage::supportsExtension):
    (ErrorPage::extension):
    (tst_QWebPage::errorPageExtension):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49498 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index bc13357..f4f3e04 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -2,6 +2,19 @@
 
         Reviewed by Simon Hausmann.
 
+        [Qt] Add some initial autotests for QWebPage's ErrorPageExtention
+        https://bugs.webkit.org/show_bug.cgi?id=30296
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (ErrorPage::ErrorPage):
+        (ErrorPage::supportsExtension):
+        (ErrorPage::extension):
+        (tst_QWebPage::errorPageExtension):
+
+2009-10-13  Antonio Gomes  <tonikitoo at webkit.org>
+
+        Reviewed by Simon Hausmann.
+
         [Qt] better handle possible edge cases on qwebframe::requestedUrl use
         https://bugs.webkit.org/show_bug.cgi?id=30216
 
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index f72655c..7ea9c2e 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -120,6 +120,7 @@ private slots:
     void consoleOutput();
     void inputMethods();
     void defaultTextEncoding();
+    void errorPageExtension();
 
     void crashTests_LazyInitializationOfMainFrame();
 
@@ -1487,6 +1488,55 @@ void tst_QWebPage::defaultTextEncoding()
     QCOMPARE(QWebSettings::globalSettings()->defaultTextEncoding(), charset);
 }
 
+class ErrorPage : public QWebPage
+{
+public:
+
+    ErrorPage(QWidget* parent = 0): QWebPage(parent)
+    {
+    }
+
+    virtual bool supportsExtension(Extension extension) const
+    {
+        return extension == ErrorPageExtension;
+    }
+
+    virtual bool extension(Extension, const ExtensionOption* option, ExtensionReturn* output)
+    {
+        const ErrorPageExtensionOption* info = static_cast<const ErrorPageExtensionOption*>(option);
+        ErrorPageExtensionReturn* errorPage = static_cast<ErrorPageExtensionReturn*>(output);
+
+        if (info->frame == mainFrame()) {
+            errorPage->content = "data:text/html,error";
+            return true;
+        }
+
+        return false;
+    }
+};
+
+void tst_QWebPage::errorPageExtension()
+{
+    ErrorPage* page = new ErrorPage;
+    m_view->setPage(page);
+
+    QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
+
+    page->mainFrame()->load(QUrl("qrc:///frametest/index.html"));
+    QTRY_COMPARE(spyLoadFinished.count(), 1);
+
+    page->mainFrame()->setUrl(QUrl("http://non.existent/url"));
+    QTest::qWait(2000);
+    QTRY_COMPARE(spyLoadFinished.count(), 2);
+    QCOMPARE(page->mainFrame()->toPlainText(), QString("data:text/html,error"));
+    QCOMPARE(page->history()->count(), 2);
+    QCOMPARE(page->history()->currentItem().url(), QUrl("http://non.existent/url"));
+    QCOMPARE(page->history()->canGoBack(), true);
+    QCOMPARE(page->history()->canGoForward(), false);
+
+    m_view->setPage(0);
+}
+
 void tst_QWebPage::crashTests_LazyInitializationOfMainFrame()
 {
     {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list