Changeset 143480 in webkit


Ignore:
Timestamp:
Feb 20, 2013, 10:45:45 AM (12 years ago)
Author:
jochen@chromium.org
Message:

[chromium] use a WebTestProxyBase pointer to identify the window we need the history for
https://bugs.webkit.org/show_bug.cgi?id=110346

Reviewed by Adam Barth.

Using an index is very brittle, as the TestRunner API does not define
any ordering of windows.

Also, make TestRunner::shouldDumpBackForwardList() so content shell can
trigger the capturing in the browser process before generating the
text dump.

  • DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:

(WebTestRunner):
(WebTestRunner::WebTestDelegate::captureHistoryForWindow):

  • DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:

(WebTestRunner):

  • DumpRenderTree/chromium/TestRunner/src/TestRunner.h:

(TestRunner):

  • DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:

(WebTestRunner::WebTestProxyBase::captureTree):

  • DumpRenderTree/chromium/WebViewHost.cpp:

(WebViewHost::captureHistoryForWindow):

  • DumpRenderTree/chromium/WebViewHost.h:

(WebViewHost):

Location:
trunk/Tools
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r143470 r143480  
     12013-02-20  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] use a WebTestProxyBase pointer to identify the window we need the history for
     4        https://bugs.webkit.org/show_bug.cgi?id=110346
     5
     6        Reviewed by Adam Barth.
     7
     8        Using an index is very brittle, as the TestRunner API does not define
     9        any ordering of windows.
     10
     11        Also, make TestRunner::shouldDumpBackForwardList() so content shell can
     12        trigger the capturing in the browser process before generating the
     13        text dump.
     14
     15        * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
     16        (WebTestRunner):
     17        (WebTestRunner::WebTestDelegate::captureHistoryForWindow):
     18        * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
     19        (WebTestRunner):
     20        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
     21        (TestRunner):
     22        * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
     23        (WebTestRunner::WebTestProxyBase::captureTree):
     24        * DumpRenderTree/chromium/WebViewHost.cpp:
     25        (WebViewHost::captureHistoryForWindow):
     26        * DumpRenderTree/chromium/WebViewHost.h:
     27        (WebViewHost):
     28
    1292013-02-19  Rouslan Solomakhin  <rouslan@chromium.org>
    230
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h

    r143457 r143480  
    3737#include <string>
    3838
     39#define WEBTESTRUNNER_NEW_HISTORY_CAPTURE
     40
    3941namespace WebKit {
    4042class WebGamepads;
     
    4850struct WebPreferences;
    4951class WebTask;
     52class WebTestProxyBase;
    5053
    5154class WebTestDelegate {
     
    9497    virtual void loadURLForFrame(const WebKit::WebURL&, const std::string&) { }
    9598    virtual bool allowExternalPages() { return false; }
    96     virtual void captureHistoryForWindow(size_t windowIndex, WebKit::WebVector<WebKit::WebHistoryItem>* history, size_t* currentEntryIndex) { }
     99    virtual void captureHistoryForWindow(WebTestProxyBase*, WebKit::WebVector<WebKit::WebHistoryItem>* history, size_t* currentEntryIndex) { }
    97100};
    98101
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h

    r142929 r143480  
    4444    virtual bool shouldDumpAsAudio() const = 0;
    4545    virtual const WebKit::WebArrayBufferView* audioData() const = 0;
     46    virtual bool shouldDumpBackForwardList() const = 0;
    4647    virtual WebKit::WebPermissionClient* webPermissions() const = 0;
    4748};
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h

    r143457 r143480  
    7979    virtual bool shouldDumpAsAudio() const OVERRIDE;
    8080    virtual const WebKit::WebArrayBufferView* audioData() const OVERRIDE;
     81    virtual bool shouldDumpBackForwardList() const OVERRIDE;
    8182    virtual WebKit::WebPermissionClient* webPermissions() const OVERRIDE;
    8283
     
    8788    bool isPrinting() const;
    8889    bool shouldDumpAsText();
    89     bool shouldDumpBackForwardList() const;
    9090    bool shouldDumpChildFrameScrollPositions() const;
    9191    bool shouldDumpChildFramesAsText() const;
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp

    r143457 r143480  
    401401}
    402402
    403 string dumpAllBackForwardLists(WebTestDelegate* delegate, unsigned windowCount)
     403string dumpAllBackForwardLists(TestInterfaces* interfaces, WebTestDelegate* delegate)
    404404{
    405405    string result;
    406     for (unsigned i = 0; i < windowCount; ++i) {
     406    const vector<WebTestProxyBase*>& windowList = interfaces->windowList();
     407    for (unsigned i = 0; i < windowList.size(); ++i) {
    407408        size_t currentEntryIndex = 0;
    408409        WebVector<WebHistoryItem> history;
    409         delegate->captureHistoryForWindow(i, &history, &currentEntryIndex);
     410        delegate->captureHistoryForWindow(windowList.at(i), &history, &currentEntryIndex);
    410411        dumpBackForwardList(history, currentEntryIndex, result);
    411412    }
     
    489490
    490491    if (m_testInterfaces->testRunner()->shouldDumpBackForwardList())
    491         dataUtf8 += dumpAllBackForwardLists(m_delegate, m_testInterfaces->windowList().size());
     492        dataUtf8 += dumpAllBackForwardLists(m_testInterfaces, m_delegate);
    492493
    493494    return dataUtf8;
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp

    r143457 r143480  
    714714}
    715715
    716 void WebViewHost::captureHistoryForWindow(size_t windowIndex, WebVector<WebHistoryItem>* history, size_t* currentEntryIndex)
    717 {
    718     m_shell->captureHistoryForWindow(windowIndex, history, currentEntryIndex);
     716void WebViewHost::captureHistoryForWindow(WebTestProxyBase* proxy, WebVector<WebHistoryItem>* history, size_t* currentEntryIndex)
     717{
     718    for (size_t i = 0; i < m_shell->windowList().size(); ++i) {
     719        if (m_shell->windowList()[i]->proxy() == proxy)
     720            m_shell->captureHistoryForWindow(i, history, currentEntryIndex);
     721    }
    719722}
    720723
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.h

    r143457 r143480  
    120120    virtual void loadURLForFrame(const WebKit::WebURL&, const std::string& frameName) OVERRIDE;
    121121    virtual bool allowExternalPages() OVERRIDE;
    122     virtual void captureHistoryForWindow(size_t windowIndex, WebKit::WebVector<WebKit::WebHistoryItem>*, size_t* currentEntryIndex) OVERRIDE;
     122    virtual void captureHistoryForWindow(WebTestRunner::WebTestProxyBase*, WebKit::WebVector<WebKit::WebHistoryItem>*, size_t* currentEntryIndex) OVERRIDE;
    123123
    124124    // NavigationHost
Note: See TracChangeset for help on using the changeset viewer.