Changeset 51037 in webkit


Ignore:
Timestamp:
Nov 16, 2009 7:37:09 AM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

[Qt] Implement load error pages support for Qt's DRT.
https://bugs.webkit.org/show_bug.cgi?id=31509

Reviewed by Kenneth Christiansen.

For now, it will not be a default feature, and layout tests
that want to make use of this have to explicitily call
'handleErrorPages();' for the test source.

Any of the other DumpRenderTree's (mac, win and gtk)
support handling error pages. Qt's will be the first.

  • DumpRenderTree/qt/DumpRenderTree.cpp:

(WebCore::WebPage::supportsExtension):
(WebCore::WebPage::extension):

  • DumpRenderTree/qt/LayoutTestControllerQt.cpp:

(LayoutTestController::reset):

  • DumpRenderTree/qt/LayoutTestControllerQt.h:

(LayoutTestController::shouldHandleErrorPages):
(LayoutTestController::handleErrorPages):

Location:
trunk/WebKitTools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r51036 r51037  
     12009-11-14  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Kenneth Christiansen.
     4
     5        [Qt] Implement load error pages support for Qt's DRT.
     6        https://bugs.webkit.org/show_bug.cgi?id=31509
     7
     8        For now, it will not be a default feature, and layout tests
     9        that want to make use of this have to explicitily call
     10        'handleErrorPages();' for the test source.
     11
     12        Any of the other DumpRenderTree's (mac, win and gtk)
     13        support handling error pages. Qt's will be the first.
     14
     15        * DumpRenderTree/qt/DumpRenderTree.cpp:
     16        (WebCore::WebPage::supportsExtension):
     17        (WebCore::WebPage::extension):
     18        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     19        (LayoutTestController::reset):
     20        * DumpRenderTree/qt/LayoutTestControllerQt.h:
     21        (LayoutTestController::shouldHandleErrorPages):
     22        (LayoutTestController::handleErrorPages):
     23
    1242009-11-16  Eric Seidel  <eric@webkit.org>
    225
  • trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp

    r50959 r51037  
    215215}
    216216
     217bool WebPage::supportsExtension(QWebPage::Extension extension) const
     218{
     219    if (extension == QWebPage::ErrorPageExtension)
     220        return m_drt->layoutTestController()->shouldHandleErrorPages();
     221
     222    return false;
     223}
     224
     225bool WebPage::extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output)
     226{
     227    const QWebPage::ErrorPageExtensionOption* info = static_cast<const QWebPage::ErrorPageExtensionOption*>(option);
     228
     229    // Lets handle error pages for the main frame for now.
     230    if (info->frame != mainFrame())
     231        return false;
     232
     233    QWebPage::ErrorPageExtensionReturn* errorPage = static_cast<QWebPage::ErrorPageExtensionReturn*>(output);
     234
     235    errorPage->content = QString("data:text/html,<body/>").toUtf8();
     236
     237    return true;
     238}
     239
    217240DumpRenderTree::DumpRenderTree()
    218241    : m_dumpPixels(false)
  • trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTree.h

    r50942 r51037  
    6868    void resetSettings();
    6969    void enableTextOutput(bool enable) { m_enableTextOutput = enable; }
     70
     71    virtual bool supportsExtension(QWebPage::Extension extension) const;
     72    virtual bool extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output);
    7073
    7174public slots:
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r50938 r51037  
    6565    m_topLoadingFrame = 0;
    6666    m_waitForPolicy = false;
     67    m_handleErrorPages = false;
    6768    qt_dump_editing_callbacks(false);
    6869    qt_dump_resource_load_callbacks(false);
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h

    r50621 r51037  
    6464    bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; }
    6565    bool shouldWaitUntilDone() const { return m_waitForDone; }
     66    bool shouldHandleErrorPages() const { return m_handleErrorPages; }
    6667    bool canOpenWindows() const { return m_canOpenWindows; }
    6768    bool shouldDumpTitleChanges() const { return m_dumpTitleChanges; }
     
    8889    void notifyDone();
    8990    void dumpBackForwardList() { m_dumpBackForwardList = true; }
     91    void handleErrorPages() { m_handleErrorPages = true; }
    9092    void dumpEditingCallbacks();
    9193    void dumpResourceLoadCallbacks();
     
    141143    bool m_dumpStatusCallbacks;
    142144    bool m_waitForPolicy;
     145    bool m_handleErrorPages;
    143146
    144147    QBasicTimer m_timeoutTimer;
Note: See TracChangeset for help on using the changeset viewer.