Changeset 139090 in webkit


Ignore:
Timestamp:
Jan 8, 2013 11:49:34 AM (11 years ago)
Author:
jochen@chromium.org
Message:

[chromium] move dumpFrameLoadCallbacks and friends to the TestRunner library
https://bugs.webkit.org/show_bug.cgi?id=106324

Reviewed by Adam Barth.

Since the frame load callbacks are part of the WebFrameClient, the
WebTestProxy is now intercepting both WebViewClient and WebFrameClient
methods.

  • DumpRenderTree/chromium/DRTTestRunner.cpp:

(DRTTestRunner::DRTTestRunner):
(DRTTestRunner::reset):

  • DumpRenderTree/chromium/DRTTestRunner.h:

(DRTTestRunner):

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

(WebTestInterfaces):

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

(WebKit):
(WebTestProxyBase):
(WebTestRunner):
(WebTestRunner::WebTestProxy::WebTestProxy):
(WebTestProxy):
(WebTestRunner::WebTestProxy::didInvalidateRect):
(WebTestRunner::WebTestProxy::didScrollRect):
(WebTestRunner::WebTestProxy::scheduleComposite):
(WebTestRunner::WebTestProxy::scheduleAnimation):
(WebTestRunner::WebTestProxy::setWindowRect):
(WebTestRunner::WebTestProxy::show):
(WebTestRunner::WebTestProxy::didAutoResize):
(WebTestRunner::WebTestProxy::postAccessibilityNotification):
(WebTestRunner::WebTestProxy::startDragging):
(WebTestRunner::WebTestProxy::shouldBeginEditing):
(WebTestRunner::WebTestProxy::shouldEndEditing):
(WebTestRunner::WebTestProxy::shouldInsertNode):
(WebTestRunner::WebTestProxy::shouldInsertText):
(WebTestRunner::WebTestProxy::shouldChangeSelectedRange):
(WebTestRunner::WebTestProxy::shouldDeleteRange):
(WebTestRunner::WebTestProxy::shouldApplyStyle):
(WebTestRunner::WebTestProxy::didBeginEditing):
(WebTestRunner::WebTestProxy::didChangeSelection):
(WebTestRunner::WebTestProxy::didChangeContents):
(WebTestRunner::WebTestProxy::didEndEditing):
(WebTestRunner::WebTestProxy::registerIntentService):
(WebTestRunner::WebTestProxy::dispatchIntent):
(WebTestRunner::WebTestProxy::willPerformClientRedirect):
(WebTestRunner::WebTestProxy::didCancelClientRedirect):
(WebTestRunner::WebTestProxy::didStartProvisionalLoad):
(WebTestRunner::WebTestProxy::didReceiveServerRedirectForProvisionalLoad):
(WebTestRunner::WebTestProxy::didFailProvisionalLoad):
(WebTestRunner::WebTestProxy::didCommitProvisionalLoad):
(WebTestRunner::WebTestProxy::didReceiveTitle):
(WebTestRunner::WebTestProxy::didFinishDocumentLoad):
(WebTestRunner::WebTestProxy::didHandleOnloadEvents):
(WebTestRunner::WebTestProxy::didFailLoad):
(WebTestRunner::WebTestProxy::didFinishLoad):
(WebTestRunner::WebTestProxy::didChangeLocationWithinPage):
(WebTestRunner::WebTestProxy::didDisplayInsecureContent):
(WebTestRunner::WebTestProxy::didRunInsecureContent):
(WebTestRunner::WebTestProxy::didDetectXSS):

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

(WebTestRunner::WebTestRunner::setTestIsRunning):
(WebTestRunner::WebTestRunner::shouldDumpFrameLoadCallbacks):
(WebTestRunner::WebTestRunner::setShouldDumpFrameLoadCallbacks):
(WebTestRunner::WebTestRunner::shouldDumpUserGestureInFrameLoadCallbacks):
(WebTestRunner::WebTestRunner::stopProvisionalFrameLoads):
(WebTestRunner::WebTestRunner::shouldDumpTitleChanges):

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

(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::reset):
(WebTestRunner::TestRunner::setTestIsRunning):
(WebTestRunner):
(WebTestRunner::TestRunner::shouldDumpFrameLoadCallbacks):
(WebTestRunner::TestRunner::setShouldDumpFrameLoadCallbacks):
(WebTestRunner::TestRunner::shouldDumpUserGestureInFrameLoadCallbacks):
(WebTestRunner::TestRunner::stopProvisionalFrameLoads):
(WebTestRunner::TestRunner::shouldDumpTitleChanges):
(WebTestRunner::TestRunner::dumpFrameLoadCallbacks):
(WebTestRunner::TestRunner::dumpUserGestureInFrameLoadCallbacks):
(WebTestRunner::TestRunner::setStopProvisionalFrameLoads):
(WebTestRunner::TestRunner::dumpTitleChanges):

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

(TestRunner):

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

(WebTestInterfaces::Internal):
(WebTestRunner::WebTestInterfaces::Internal::webView):
(WebTestRunner::WebTestInterfaces::Internal::Internal):
(WebTestRunner::WebTestInterfaces::Internal::setWebView):
(WebTestRunner):
(WebTestRunner::WebTestInterfaces::Internal::setTestIsRunning):
(WebTestRunner::WebTestInterfaces::setWebView):
(WebTestRunner::WebTestInterfaces::setTestIsRunning):
(WebTestRunner::WebTestInterfaces::webView):

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

(WebTestRunner::WebTestProxyBase::willPerformClientRedirect):
(WebTestRunner):
(WebTestRunner::WebTestProxyBase::didCancelClientRedirect):
(WebTestRunner::WebTestProxyBase::didStartProvisionalLoad):
(WebTestRunner::WebTestProxyBase::didReceiveServerRedirectForProvisionalLoad):
(WebTestRunner::WebTestProxyBase::didFailProvisionalLoad):
(WebTestRunner::WebTestProxyBase::didCommitProvisionalLoad):
(WebTestRunner::WebTestProxyBase::didReceiveTitle):
(WebTestRunner::WebTestProxyBase::didFinishDocumentLoad):
(WebTestRunner::WebTestProxyBase::didHandleOnloadEvents):
(WebTestRunner::WebTestProxyBase::didFailLoad):
(WebTestRunner::WebTestProxyBase::didFinishLoad):
(WebTestRunner::WebTestProxyBase::didChangeLocationWithinPage):
(WebTestRunner::WebTestProxyBase::didDisplayInsecureContent):
(WebTestRunner::WebTestProxyBase::didRunInsecureContent):
(WebTestRunner::WebTestProxyBase::didDetectXSS):

  • DumpRenderTree/chromium/TestShell.cpp:

(TestShell::runFileTest):
(TestShell::testFinished):

  • DumpRenderTree/chromium/TestShell.h:

(TestShell):

  • DumpRenderTree/chromium/WebViewHost.cpp:

(WebViewHost::didStartProvisionalLoad):
(WebViewHost::didReceiveServerRedirectForProvisionalLoad):
(WebViewHost::didFailProvisionalLoad):
(WebViewHost::didCommitProvisionalLoad):
(WebViewHost::didReceiveTitle):
(WebViewHost::didFailLoad):
(WebViewHost::didFinishLoad):

  • DumpRenderTree/chromium/WebViewHost.h:

(WebViewHost):

Location:
trunk/Tools
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r139088 r139090  
     12013-01-08  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] move dumpFrameLoadCallbacks and friends to the TestRunner library
     4        https://bugs.webkit.org/show_bug.cgi?id=106324
     5
     6        Reviewed by Adam Barth.
     7
     8        Since the frame load callbacks are part of the WebFrameClient, the
     9        WebTestProxy is now intercepting both WebViewClient and WebFrameClient
     10        methods.
     11
     12        * DumpRenderTree/chromium/DRTTestRunner.cpp:
     13        (DRTTestRunner::DRTTestRunner):
     14        (DRTTestRunner::reset):
     15        * DumpRenderTree/chromium/DRTTestRunner.h:
     16        (DRTTestRunner):
     17        * DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h:
     18        (WebTestInterfaces):
     19        * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
     20        (WebKit):
     21        (WebTestProxyBase):
     22        (WebTestRunner):
     23        (WebTestRunner::WebTestProxy::WebTestProxy):
     24        (WebTestProxy):
     25        (WebTestRunner::WebTestProxy::didInvalidateRect):
     26        (WebTestRunner::WebTestProxy::didScrollRect):
     27        (WebTestRunner::WebTestProxy::scheduleComposite):
     28        (WebTestRunner::WebTestProxy::scheduleAnimation):
     29        (WebTestRunner::WebTestProxy::setWindowRect):
     30        (WebTestRunner::WebTestProxy::show):
     31        (WebTestRunner::WebTestProxy::didAutoResize):
     32        (WebTestRunner::WebTestProxy::postAccessibilityNotification):
     33        (WebTestRunner::WebTestProxy::startDragging):
     34        (WebTestRunner::WebTestProxy::shouldBeginEditing):
     35        (WebTestRunner::WebTestProxy::shouldEndEditing):
     36        (WebTestRunner::WebTestProxy::shouldInsertNode):
     37        (WebTestRunner::WebTestProxy::shouldInsertText):
     38        (WebTestRunner::WebTestProxy::shouldChangeSelectedRange):
     39        (WebTestRunner::WebTestProxy::shouldDeleteRange):
     40        (WebTestRunner::WebTestProxy::shouldApplyStyle):
     41        (WebTestRunner::WebTestProxy::didBeginEditing):
     42        (WebTestRunner::WebTestProxy::didChangeSelection):
     43        (WebTestRunner::WebTestProxy::didChangeContents):
     44        (WebTestRunner::WebTestProxy::didEndEditing):
     45        (WebTestRunner::WebTestProxy::registerIntentService):
     46        (WebTestRunner::WebTestProxy::dispatchIntent):
     47        (WebTestRunner::WebTestProxy::willPerformClientRedirect):
     48        (WebTestRunner::WebTestProxy::didCancelClientRedirect):
     49        (WebTestRunner::WebTestProxy::didStartProvisionalLoad):
     50        (WebTestRunner::WebTestProxy::didReceiveServerRedirectForProvisionalLoad):
     51        (WebTestRunner::WebTestProxy::didFailProvisionalLoad):
     52        (WebTestRunner::WebTestProxy::didCommitProvisionalLoad):
     53        (WebTestRunner::WebTestProxy::didReceiveTitle):
     54        (WebTestRunner::WebTestProxy::didFinishDocumentLoad):
     55        (WebTestRunner::WebTestProxy::didHandleOnloadEvents):
     56        (WebTestRunner::WebTestProxy::didFailLoad):
     57        (WebTestRunner::WebTestProxy::didFinishLoad):
     58        (WebTestRunner::WebTestProxy::didChangeLocationWithinPage):
     59        (WebTestRunner::WebTestProxy::didDisplayInsecureContent):
     60        (WebTestRunner::WebTestProxy::didRunInsecureContent):
     61        (WebTestRunner::WebTestProxy::didDetectXSS):
     62        * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
     63        (WebTestRunner::WebTestRunner::setTestIsRunning):
     64        (WebTestRunner::WebTestRunner::shouldDumpFrameLoadCallbacks):
     65        (WebTestRunner::WebTestRunner::setShouldDumpFrameLoadCallbacks):
     66        (WebTestRunner::WebTestRunner::shouldDumpUserGestureInFrameLoadCallbacks):
     67        (WebTestRunner::WebTestRunner::stopProvisionalFrameLoads):
     68        (WebTestRunner::WebTestRunner::shouldDumpTitleChanges):
     69        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
     70        (WebTestRunner::TestRunner::TestRunner):
     71        (WebTestRunner::TestRunner::reset):
     72        (WebTestRunner::TestRunner::setTestIsRunning):
     73        (WebTestRunner):
     74        (WebTestRunner::TestRunner::shouldDumpFrameLoadCallbacks):
     75        (WebTestRunner::TestRunner::setShouldDumpFrameLoadCallbacks):
     76        (WebTestRunner::TestRunner::shouldDumpUserGestureInFrameLoadCallbacks):
     77        (WebTestRunner::TestRunner::stopProvisionalFrameLoads):
     78        (WebTestRunner::TestRunner::shouldDumpTitleChanges):
     79        (WebTestRunner::TestRunner::dumpFrameLoadCallbacks):
     80        (WebTestRunner::TestRunner::dumpUserGestureInFrameLoadCallbacks):
     81        (WebTestRunner::TestRunner::setStopProvisionalFrameLoads):
     82        (WebTestRunner::TestRunner::dumpTitleChanges):
     83        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
     84        (TestRunner):
     85        * DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp:
     86        (WebTestInterfaces::Internal):
     87        (WebTestRunner::WebTestInterfaces::Internal::webView):
     88        (WebTestRunner::WebTestInterfaces::Internal::Internal):
     89        (WebTestRunner::WebTestInterfaces::Internal::setWebView):
     90        (WebTestRunner):
     91        (WebTestRunner::WebTestInterfaces::Internal::setTestIsRunning):
     92        (WebTestRunner::WebTestInterfaces::setWebView):
     93        (WebTestRunner::WebTestInterfaces::setTestIsRunning):
     94        (WebTestRunner::WebTestInterfaces::webView):
     95        * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
     96        (WebTestRunner::WebTestProxyBase::willPerformClientRedirect):
     97        (WebTestRunner):
     98        (WebTestRunner::WebTestProxyBase::didCancelClientRedirect):
     99        (WebTestRunner::WebTestProxyBase::didStartProvisionalLoad):
     100        (WebTestRunner::WebTestProxyBase::didReceiveServerRedirectForProvisionalLoad):
     101        (WebTestRunner::WebTestProxyBase::didFailProvisionalLoad):
     102        (WebTestRunner::WebTestProxyBase::didCommitProvisionalLoad):
     103        (WebTestRunner::WebTestProxyBase::didReceiveTitle):
     104        (WebTestRunner::WebTestProxyBase::didFinishDocumentLoad):
     105        (WebTestRunner::WebTestProxyBase::didHandleOnloadEvents):
     106        (WebTestRunner::WebTestProxyBase::didFailLoad):
     107        (WebTestRunner::WebTestProxyBase::didFinishLoad):
     108        (WebTestRunner::WebTestProxyBase::didChangeLocationWithinPage):
     109        (WebTestRunner::WebTestProxyBase::didDisplayInsecureContent):
     110        (WebTestRunner::WebTestProxyBase::didRunInsecureContent):
     111        (WebTestRunner::WebTestProxyBase::didDetectXSS):
     112        * DumpRenderTree/chromium/TestShell.cpp:
     113        (TestShell::runFileTest):
     114        (TestShell::testFinished):
     115        * DumpRenderTree/chromium/TestShell.h:
     116        (TestShell):
     117        * DumpRenderTree/chromium/WebViewHost.cpp:
     118        (WebViewHost::didStartProvisionalLoad):
     119        (WebViewHost::didReceiveServerRedirectForProvisionalLoad):
     120        (WebViewHost::didFailProvisionalLoad):
     121        (WebViewHost::didCommitProvisionalLoad):
     122        (WebViewHost::didReceiveTitle):
     123        (WebViewHost::didFailLoad):
     124        (WebViewHost::didFinishLoad):
     125        * DumpRenderTree/chromium/WebViewHost.h:
     126        (WebViewHost):
     127
    11282013-01-08  Zan Dobersek  <zandobersek@gmail.com>
    2129
  • trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp

    r138993 r139090  
    119119    bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion);
    120120    bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList);
    121     bindMethod("dumpFrameLoadCallbacks", &DRTTestRunner::dumpFrameLoadCallbacks);
    122121    bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback);
    123     bindMethod("dumpUserGestureInFrameLoadCallbacks", &DRTTestRunner::dumpUserGestureInFrameLoadCallbacks);
    124122    bindMethod("dumpResourceLoadCallbacks", &DRTTestRunner::dumpResourceLoadCallbacks);
    125123    bindMethod("dumpResourceRequestCallbacks", &DRTTestRunner::dumpResourceRequestCallbacks);
     
    127125    bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect);
    128126    bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges);
    129     bindMethod("dumpTitleChanges", &DRTTestRunner::dumpTitleChanges);
    130127    bindMethod("dumpPermissionClientCallbacks", &DRTTestRunner::dumpPermissionClientCallbacks);
    131128    bindMethod("dumpCreateView", &DRTTestRunner::dumpCreateView);
     
    167164    bindMethod("setBackingScaleFactor", &DRTTestRunner::setBackingScaleFactor);
    168165    bindMethod("setSmartInsertDeleteEnabled", &DRTTestRunner::setSmartInsertDeleteEnabled);
    169     bindMethod("setStopProvisionalFrameLoads", &DRTTestRunner::setStopProvisionalFrameLoads);
    170166    bindMethod("setWillSendRequestClearHeader", &DRTTestRunner::setWillSendRequestClearHeader);
    171167    bindMethod("setWillSendRequestReturnsNull", &DRTTestRunner::setWillSendRequestReturnsNull);
     
    252248}
    253249
    254 void DRTTestRunner::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
    255 {
    256     m_dumpFrameLoadCallbacks = true;
    257     result->setNull();
    258 }
    259 
    260250void DRTTestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result)
    261251{
     
    264254}
    265255
    266 void DRTTestRunner::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
    267 {
    268     m_dumpUserGestureInFrameLoadCallbacks = true;
    269     result->setNull();
    270 }
    271 
    272256void DRTTestRunner::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result)
    273257{
     
    291275{
    292276    m_dumpWindowStatusChanges = true;
    293     result->setNull();
    294 }
    295 
    296 void DRTTestRunner::dumpTitleChanges(const CppArgumentList&, CppVariant* result)
    297 {
    298     m_dumpTitleChanges = true;
    299277    result->setNull();
    300278}
     
    497475        m_shell->webViewHost()->setDeviceScaleFactor(1);
    498476    m_dumpCreateView = false;
    499     m_dumpFrameLoadCallbacks = false;
    500477    m_dumpProgressFinishedCallback = false;
    501     m_dumpUserGestureInFrameLoadCallbacks = false;
    502478    m_dumpResourceLoadCallbacks = false;
    503479    m_dumpResourceRequestCallbacks = false;
     
    506482    m_dumpWindowStatusChanges = false;
    507483    m_dumpSelectionRect = false;
    508     m_dumpTitleChanges = false;
    509484    m_dumpPermissionClientCallbacks = false;
    510485    m_waitUntilDone = false;
     
    512487    m_testRepaint = false;
    513488    m_sweepHorizontally = false;
    514     m_stopProvisionalFrameLoads = false;
    515489    m_deferMainResourceDataLoad = true;
    516490    m_webHistoryItemCount.set(0);
     
    706680}
    707681
    708 void DRTTestRunner::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result)
    709 {
    710     result->setNull();
    711     m_stopProvisionalFrameLoads = true;
    712 }
    713 
    714682void DRTTestRunner::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result)
    715683{
  • trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h

    r138993 r139090  
    7777
    7878    // This function sets a flag that tells the test_shell to print a line of
    79     // descriptive text for each frame load callback. It takes no arguments, and
    80     // ignores any that may be present.
    81     void dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
    82 
    83     // This function sets a flag that tells the test_shell to print a line of
    8479    // descriptive text for the progress finished callback. It takes no
    8580    // arguments, and ignores any that may be present.
    8681    void dumpProgressFinishedCallback(const CppArgumentList&, CppVariant*);
    87 
    88     // This function sets a flag that tells the test_shell to print a line of
    89     // user gesture status text for some frame load callbacks. It takes no
    90     // arguments, and ignores any that may be present.
    91     void dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
    9282
    9383    // This function sets a flag that tells the test_shell to print out a text
     
    171161    void pathToLocalResource(const CppArgumentList&, CppVariant*);
    172162
    173     // If true, causes provisional frame loads to be stopped for the remainder of
    174     // the test.
    175     void setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant*);
    176 
    177163    // Enable or disable smart insert/delete. This is enabled by default.
    178164    void setSmartInsertDeleteEnabled(const CppArgumentList&, CppVariant*);
     
    193179    void setDeferMainResourceDataLoad(const CppArgumentList&, CppVariant*);
    194180
    195     void dumpTitleChanges(const CppArgumentList&, CppVariant*);
    196181    void display(const CppArgumentList&, CppVariant*);
    197182    void displayInvalidatedRegion(const CppArgumentList&, CppVariant*);
     
    263248    void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
    264249
    265     bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
    266     void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
    267250    bool shouldDumpProgressFinishedCallback() { return m_dumpProgressFinishedCallback; }
    268251    void setShouldDumpProgressFinishedCallback(bool value) { m_dumpProgressFinishedCallback = value; }
    269     bool shouldDumpUserGestureInFrameLoadCallbacks() { return m_dumpUserGestureInFrameLoadCallbacks; }
    270     void setShouldDumpUserGestureInFrameLoadCallbacks(bool value) { m_dumpUserGestureInFrameLoadCallbacks = value; }
    271252    bool shouldDumpResourceLoadCallbacks() {return m_dumpResourceLoadCallbacks; }
    272253    void setShouldDumpResourceRequestCallbacks(bool value) { m_dumpResourceRequestCallbacks = value; }
     
    277258    bool shouldDumpSelectionRect() { return m_dumpSelectionRect; }
    278259    bool shouldDumpBackForwardList() { return m_dumpBackForwardList; }
    279     bool shouldDumpTitleChanges() { return m_dumpTitleChanges; }
    280260    bool shouldDumpPermissionClientCallbacks() { return m_dumpPermissionClientCallbacks; }
    281261    bool shouldDumpCreateView() { return m_dumpCreateView; }
    282262    bool canOpenWindows() { return m_canOpenWindows; }
    283     bool stopProvisionalFrameLoads() { return m_stopProvisionalFrameLoads; }
    284263    bool deferMainResourceDataLoad() { return m_deferMainResourceDataLoad; }
    285264    void setShowDebugLayerTree(bool value) { m_showDebugLayerTree = value; }
     
    375354    bool m_dumpSelectionRect;
    376355
    377     // If true, the test_shell will output a descriptive line for each frame
    378     // load callback.
    379     bool m_dumpFrameLoadCallbacks;
    380 
    381356    // If true, the test_shell will output a descriptive line for the progress
    382357    // finished callback.
    383358    bool m_dumpProgressFinishedCallback;
    384359
    385     // If true, the test_shell will output a line of the user gesture status
    386     // text for some frame load callbacks.
    387     bool m_dumpUserGestureInFrameLoadCallbacks;
    388 
    389360    // If true, the test_shell will output a descriptive line for each resource
    390361    // load callback.
     
    405376    // If true, the test_shell will dump all changes to window.status.
    406377    bool m_dumpWindowStatusChanges;
    407 
    408     // If true, output a message when the page title is changed.
    409     bool m_dumpTitleChanges;
    410378
    411379    // If true, output a descriptive line each time a permission client
     
    434402    bool m_sweepHorizontally;
    435403
    436     // If true, stops provisional frame loads during the
    437     // DidStartProvisionalLoadForFrame callback.
    438     bool m_stopProvisionalFrameLoads;
    439 
    440404    // If true, don't dump output until notifyDone is called.
    441405    bool m_waitUntilDone;
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h

    r137993 r139090  
    5353    void bindTo(WebKit::WebFrame*);
    5454    void resetAll();
     55    void setTestIsRunning(bool);
    5556
     57    WebKit::WebView* webView() const;
    5658    WebAccessibilityController* accessibilityController();
    5759    WebEventSender* eventSender();
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h

    r137997 r139090  
    3838#include "WebKit/chromium/public/WebNavigationPolicy.h"
    3939#include "WebKit/chromium/public/WebTextAffinity.h"
     40#include "WebKit/chromium/public/WebTextDirection.h"
    4041
    4142namespace WebKit {
     
    4849class WebNode;
    4950class WebRange;
     51class WebSecurityOrigin;
     52class WebSerializedScriptValue;
    5053class WebString;
     54class WebURL;
    5155struct WebPoint;
    52 class WebSerializedScriptValue;
    5356struct WebSize;
     57struct WebURLError;
    5458}
    5559
     
    9498    void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&);
    9599    void dispatchIntent(WebKit::WebFrame* source, const WebKit::WebIntentRequest&);
     100    void willPerformClientRedirect(WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fire_time);
     101    void didCancelClientRedirect(WebKit::WebFrame*);
     102    void didStartProvisionalLoad(WebKit::WebFrame*);
     103    void didReceiveServerRedirectForProvisionalLoad(WebKit::WebFrame*);
     104    void didFailProvisionalLoad(WebKit::WebFrame*, const WebKit::WebURLError&);
     105    void didCommitProvisionalLoad(WebKit::WebFrame*, bool isNewNavigation);
     106    void didReceiveTitle(WebKit::WebFrame*, const WebKit::WebString& title, WebKit::WebTextDirection);
     107    void didFinishDocumentLoad(WebKit::WebFrame*);
     108    void didHandleOnloadEvents(WebKit::WebFrame*);
     109    void didFailLoad(WebKit::WebFrame*, const WebKit::WebURLError&);
     110    void didFinishLoad(WebKit::WebFrame*);
     111    void didChangeLocationWithinPage(WebKit::WebFrame*);
     112    void didDisplayInsecureContent(WebKit::WebFrame*);
     113    void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&, const WebKit::WebURL& insecureURL);
     114    void didDetectXSS(WebKit::WebFrame*, const WebKit::WebURL& insecureURL, bool didBlockEntirePage);
    96115
    97116private:
     
    102121};
    103122
    104 // Use this template to inject methods into your WebViewClient implementation
    105 // required for the running layout tests.
    106 template<class WebViewClientImpl, typename T>
    107 class WebTestProxy : public WebViewClientImpl, public WebTestProxyBase {
     123// Use this template to inject methods into your WebViewClient/WebFrameClient
     124// implementation required for the running layout tests.
     125template<class Base, typename T>
     126class WebTestProxy : public Base, public WebTestProxyBase {
    108127public:
    109128    explicit WebTestProxy(T t)
    110         : WebViewClientImpl(t)
     129        : Base(t)
    111130    {
    112131    }
     
    114133    virtual ~WebTestProxy() { }
    115134
     135    // WebViewClient implementation.
    116136    virtual void didInvalidateRect(const WebKit::WebRect& rect)
    117137    {
    118138        WebTestProxyBase::didInvalidateRect(rect);
    119         WebViewClientImpl::didInvalidateRect(rect);
     139        Base::didInvalidateRect(rect);
    120140    }
    121141    virtual void didScrollRect(int dx, int dy, const WebKit::WebRect& clipRect)
    122142    {
    123143        WebTestProxyBase::didScrollRect(dx, dy, clipRect);
    124         WebViewClientImpl::didScrollRect(dx, dy, clipRect);
     144        Base::didScrollRect(dx, dy, clipRect);
    125145    }
    126146    virtual void scheduleComposite()
    127147    {
    128148        WebTestProxyBase::scheduleComposite();
    129         WebViewClientImpl::scheduleComposite();
     149        Base::scheduleComposite();
    130150    }
    131151    virtual void scheduleAnimation()
    132152    {
    133153        WebTestProxyBase::scheduleAnimation();
    134         WebViewClientImpl::scheduleAnimation();
     154        Base::scheduleAnimation();
    135155    }
    136156    virtual void setWindowRect(const WebKit::WebRect& rect)
    137157    {
    138158        WebTestProxyBase::setWindowRect(rect);
    139         WebViewClientImpl::setWindowRect(rect);
     159        Base::setWindowRect(rect);
    140160    }
    141161    virtual void show(WebKit::WebNavigationPolicy policy)
    142162    {
    143163        WebTestProxyBase::show(policy);
    144         WebViewClientImpl::show(policy);
     164        Base::show(policy);
    145165    }
    146166    virtual void didAutoResize(const WebKit::WebSize& newSize)
    147167    {
    148168        WebTestProxyBase::didAutoResize(newSize);
    149         WebViewClientImpl::didAutoResize(newSize);
     169        Base::didAutoResize(newSize);
    150170    }
    151171    virtual void postAccessibilityNotification(const WebKit::WebAccessibilityObject& object, WebKit::WebAccessibilityNotification notification)
    152172    {
    153173        WebTestProxyBase::postAccessibilityNotification(object, notification);
    154         WebViewClientImpl::postAccessibilityNotification(object, notification);
     174        Base::postAccessibilityNotification(object, notification);
    155175    }
    156176    virtual void startDragging(WebKit::WebFrame* frame, const WebKit::WebDragData& data, WebKit::WebDragOperationsMask mask, const WebKit::WebImage& image, const WebKit::WebPoint& point)
    157177    {
    158178        WebTestProxyBase::startDragging(frame, data, mask, image, point);
    159         WebViewClientImpl::startDragging(frame, data, mask, image, point);
     179        Base::startDragging(frame, data, mask, image, point);
    160180    }
    161181    virtual bool shouldBeginEditing(const WebKit::WebRange& range)
    162182    {
    163183        WebTestProxyBase::shouldBeginEditing(range);
    164         return WebViewClientImpl::shouldBeginEditing(range);
     184        return Base::shouldBeginEditing(range);
    165185    }
    166186    virtual bool shouldEndEditing(const WebKit::WebRange& range)
    167187    {
    168188        WebTestProxyBase::shouldEndEditing(range);
    169         return WebViewClientImpl::shouldEndEditing(range);
     189        return Base::shouldEndEditing(range);
    170190    }
    171191    virtual bool shouldInsertNode(const WebKit::WebNode& node, const WebKit::WebRange& range, WebKit::WebEditingAction action)
    172192    {
    173193        WebTestProxyBase::shouldInsertNode(node, range, action);
    174         return WebViewClientImpl::shouldInsertNode(node, range, action);
     194        return Base::shouldInsertNode(node, range, action);
    175195    }
    176196    virtual bool shouldInsertText(const WebKit::WebString& text, const WebKit::WebRange& range, WebKit::WebEditingAction action)
    177197    {
    178198        WebTestProxyBase::shouldInsertText(text, range, action);
    179         return WebViewClientImpl::shouldInsertText(text, range, action);
     199        return Base::shouldInsertText(text, range, action);
    180200    }
    181201    virtual bool shouldChangeSelectedRange(const WebKit::WebRange& fromRange, const WebKit::WebRange& toRange, WebKit::WebTextAffinity affinity, bool stillSelecting)
    182202    {
    183203        WebTestProxyBase::shouldChangeSelectedRange(fromRange, toRange, affinity, stillSelecting);
    184         return WebViewClientImpl::shouldChangeSelectedRange(fromRange, toRange, affinity, stillSelecting);
     204        return Base::shouldChangeSelectedRange(fromRange, toRange, affinity, stillSelecting);
    185205    }
    186206    virtual bool shouldDeleteRange(const WebKit::WebRange& range)
    187207    {
    188208        WebTestProxyBase::shouldDeleteRange(range);
    189         return WebViewClientImpl::shouldDeleteRange(range);
     209        return Base::shouldDeleteRange(range);
    190210    }
    191211    virtual bool shouldApplyStyle(const WebKit::WebString& style, const WebKit::WebRange& range)
    192212    {
    193213        WebTestProxyBase::shouldApplyStyle(style, range);
    194         return WebViewClientImpl::shouldApplyStyle(style, range);
     214        return Base::shouldApplyStyle(style, range);
    195215    }
    196216    virtual void didBeginEditing()
    197217    {
    198218        WebTestProxyBase::didBeginEditing();
    199         WebViewClientImpl::didBeginEditing();
     219        Base::didBeginEditing();
    200220    }
    201221    virtual void didChangeSelection(bool isEmptySelection)
    202222    {
    203223        WebTestProxyBase::didChangeSelection(isEmptySelection);
    204         WebViewClientImpl::didChangeSelection(isEmptySelection);
     224        Base::didChangeSelection(isEmptySelection);
    205225    }
    206226    virtual void didChangeContents()
    207227    {
    208228        WebTestProxyBase::didChangeContents();
    209         WebViewClientImpl::didChangeContents();
     229        Base::didChangeContents();
    210230    }
    211231    virtual void didEndEditing()
    212232    {
    213233        WebTestProxyBase::didEndEditing();
    214         WebViewClientImpl::didEndEditing();
     234        Base::didEndEditing();
    215235    }
    216236    virtual void registerIntentService(WebKit::WebFrame* frame, const WebKit::WebIntentServiceInfo& service)
    217237    {
    218238        WebTestProxyBase::registerIntentService(frame, service);
    219         WebViewClientImpl::registerIntentService(frame, service);
     239        Base::registerIntentService(frame, service);
    220240    }
    221241    virtual void dispatchIntent(WebKit::WebFrame* source, const WebKit::WebIntentRequest& request)
    222242    {
    223243        WebTestProxyBase::dispatchIntent(source, request);
    224         WebViewClientImpl::dispatchIntent(source, request);
     244        Base::dispatchIntent(source, request);
     245    }
     246
     247    // WebFrameClient implementation.
     248    virtual void willPerformClientRedirect(WebKit::WebFrame* frame, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fireTime)
     249    {
     250        WebTestProxyBase::willPerformClientRedirect(frame, from, to, interval, fireTime);
     251        Base::willPerformClientRedirect(frame, from, to, interval, fireTime);
     252    }
     253    virtual void didCancelClientRedirect(WebKit::WebFrame* frame)
     254    {
     255        WebTestProxyBase::didCancelClientRedirect(frame);
     256        Base::didCancelClientRedirect(frame);
     257    }
     258    virtual void didStartProvisionalLoad(WebKit::WebFrame* frame)
     259    {
     260        WebTestProxyBase::didStartProvisionalLoad(frame);
     261        Base::didStartProvisionalLoad(frame);
     262    }
     263    virtual void didReceiveServerRedirectForProvisionalLoad(WebKit::WebFrame* frame)
     264    {
     265        WebTestProxyBase::didReceiveServerRedirectForProvisionalLoad(frame);
     266        Base::didReceiveServerRedirectForProvisionalLoad(frame);
     267    }
     268    virtual void didFailProvisionalLoad(WebKit::WebFrame* frame, const WebKit::WebURLError& error)
     269    {
     270        WebTestProxyBase::didFailProvisionalLoad(frame, error);
     271        Base::didFailProvisionalLoad(frame, error);
     272    }
     273    virtual void didCommitProvisionalLoad(WebKit::WebFrame* frame, bool isNewNavigation)
     274    {
     275        WebTestProxyBase::didCommitProvisionalLoad(frame, isNewNavigation);
     276        Base::didCommitProvisionalLoad(frame, isNewNavigation);
     277    }
     278    virtual void didReceiveTitle(WebKit::WebFrame* frame, const WebKit::WebString& title, WebKit::WebTextDirection direction)
     279    {
     280        WebTestProxyBase::didReceiveTitle(frame, title, direction);
     281        Base::didReceiveTitle(frame, title, direction);
     282    }
     283    virtual void didFinishDocumentLoad(WebKit::WebFrame* frame)
     284    {
     285        WebTestProxyBase::didFinishDocumentLoad(frame);
     286        Base::didFinishDocumentLoad(frame);
     287    }
     288    virtual void didHandleOnloadEvents(WebKit::WebFrame* frame)
     289    {
     290        WebTestProxyBase::didHandleOnloadEvents(frame);
     291        Base::didHandleOnloadEvents(frame);
     292    }
     293    virtual void didFailLoad(WebKit::WebFrame* frame, const WebKit::WebURLError& error)
     294    {
     295        WebTestProxyBase::didFailLoad(frame, error);
     296        Base::didFailLoad(frame, error);
     297    }
     298    virtual void didFinishLoad(WebKit::WebFrame* frame)
     299    {
     300        WebTestProxyBase::didFinishLoad(frame);
     301        Base::didFinishLoad(frame);
     302    }
     303    virtual void didChangeLocationWithinPage(WebKit::WebFrame* frame)
     304    {
     305        WebTestProxyBase::didChangeLocationWithinPage(frame);
     306        Base::didChangeLocationWithinPage(frame);
     307    }
     308    virtual void didDisplayInsecureContent(WebKit::WebFrame* frame)
     309    {
     310        WebTestProxyBase::didDisplayInsecureContent(frame);
     311        Base::didDisplayInsecureContent(frame);
     312    }
     313    virtual void didRunInsecureContent(WebKit::WebFrame* frame, const WebKit::WebSecurityOrigin& origin, const WebKit::WebURL& insecureURL)
     314    {
     315        WebTestProxyBase::didRunInsecureContent(frame, origin, insecureURL);
     316        Base::didRunInsecureContent(frame, origin, insecureURL);
     317    }
     318    virtual void didDetectXSS(WebKit::WebFrame* frame, const WebKit::WebURL& insecureURL, bool didBlockEntirePage)
     319    {
     320        WebTestProxyBase::didDetectXSS(frame, insecureURL, didBlockEntirePage);
     321        Base::didDetectXSS(frame, insecureURL, didBlockEntirePage);
    225322    }
    226323};
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h

    r138993 r139090  
    4242class WebTestRunner {
    4343public:
     44    virtual void setTestIsRunning(bool) { }
    4445    virtual bool shouldDumpEditingCallbacks() const { return false; }
    4546    virtual bool shouldDumpAsText() const { return false; }
     
    5152    virtual bool shouldDumpAsAudio() const { return false; }
    5253    virtual const WebKit::WebArrayBufferView* audioData() const { return 0; }
     54    virtual bool shouldDumpFrameLoadCallbacks() const { return false; }
     55    virtual void setShouldDumpFrameLoadCallbacks(bool) { }
     56    virtual bool shouldDumpUserGestureInFrameLoadCallbacks() const { return false; }
     57    virtual bool stopProvisionalFrameLoads() const { return false; }
     58    virtual bool shouldDumpTitleChanges() const { return false; }
    5359};
    5460
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp

    r138993 r139090  
    7979
    8080TestRunner::TestRunner()
    81     : m_delegate(0)
     81    : m_testIsRunning(false)
     82    , m_delegate(0)
    8283    , m_webView(0)
    8384    , m_intentClient(adoptPtr(new EmptyWebDeliveredIntentClient))
     
    138139    bindMethod("dumpChildFrameScrollPositions", &TestRunner::dumpChildFrameScrollPositions);
    139140    bindMethod("setAudioData", &TestRunner::setAudioData);
     141    bindMethod("dumpFrameLoadCallbacks", &TestRunner::dumpFrameLoadCallbacks);
     142    bindMethod("dumpUserGestureInFrameLoadCallbacks", &TestRunner::dumpUserGestureInFrameLoadCallbacks);
     143    bindMethod("setStopProvisionalFrameLoads", &TestRunner::setStopProvisionalFrameLoads);
     144    bindMethod("dumpTitleChanges", &TestRunner::dumpTitleChanges);
    140145
    141146    // The following methods interact with the WebTestProxy.
     
    208213    m_dumpChildFramesAsText = false;
    209214    m_dumpAsAudio = false;
     215    m_dumpFrameLoadCallbacks = false;
     216    m_dumpUserGestureInFrameLoadCallbacks = false;
     217    m_stopProvisionalFrameLoads = false;
     218    m_dumpTitleChanges = false;
    210219
    211220    m_globalFlag.set(false);
     
    215224}
    216225
     226void TestRunner::setTestIsRunning(bool running)
     227{
     228    m_testIsRunning = running;
     229}
     230
    217231bool TestRunner::shouldDumpEditingCallbacks() const
    218232{
     
    258272{
    259273    return &m_audioData;
     274}
     275
     276bool TestRunner::shouldDumpFrameLoadCallbacks() const
     277{
     278    return m_testIsRunning && m_dumpFrameLoadCallbacks;
     279}
     280
     281void TestRunner::setShouldDumpFrameLoadCallbacks(bool value)
     282{
     283    m_dumpFrameLoadCallbacks = value;
     284}
     285
     286bool TestRunner::shouldDumpUserGestureInFrameLoadCallbacks() const
     287{
     288    return m_testIsRunning && m_dumpUserGestureInFrameLoadCallbacks;
     289}
     290
     291bool TestRunner::stopProvisionalFrameLoads() const
     292{
     293    return m_stopProvisionalFrameLoads;
     294}
     295
     296bool TestRunner::shouldDumpTitleChanges() const
     297{
     298    return m_dumpTitleChanges;
    260299}
    261300
     
    10011040}
    10021041
     1042void TestRunner::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
     1043{
     1044    m_dumpFrameLoadCallbacks = true;
     1045    result->setNull();
     1046}
     1047
     1048void TestRunner::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
     1049{
     1050    m_dumpUserGestureInFrameLoadCallbacks = true;
     1051    result->setNull();
     1052}
     1053
     1054void TestRunner::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result)
     1055{
     1056    result->setNull();
     1057    m_stopProvisionalFrameLoads = true;
     1058}
     1059
     1060void TestRunner::dumpTitleChanges(const CppArgumentList&, CppVariant* result)
     1061{
     1062    m_dumpTitleChanges = true;
     1063    result->setNull();
     1064}
     1065
    10031066void TestRunner::workerThreadCount(CppVariant* result)
    10041067{
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h

    r138993 r139090  
    6060
    6161    // WebTestRunner implementation.
     62    virtual void setTestIsRunning(bool) OVERRIDE;
    6263    virtual bool shouldDumpEditingCallbacks() const OVERRIDE;
    6364    virtual bool shouldDumpAsText() const OVERRIDE;
     
    6970    virtual bool shouldDumpAsAudio() const OVERRIDE;
    7071    virtual const WebKit::WebArrayBufferView* audioData() const OVERRIDE;
     72    virtual bool shouldDumpFrameLoadCallbacks() const OVERRIDE;
     73    virtual void setShouldDumpFrameLoadCallbacks(bool) OVERRIDE;
     74    virtual bool shouldDumpUserGestureInFrameLoadCallbacks() const OVERRIDE;
     75    virtual bool stopProvisionalFrameLoads() const OVERRIDE;
     76    virtual bool shouldDumpTitleChanges() const OVERRIDE;
    7177
    7278protected:
     
    211217    void setAudioData(const CppArgumentList&, CppVariant*);
    212218
     219    // This function sets a flag that tells the test_shell to print a line of
     220    // descriptive text for each frame load callback. It takes no arguments, and
     221    // ignores any that may be present.
     222    void dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
     223
     224    // This function sets a flag that tells the test_shell to print a line of
     225    // user gesture status text for some frame load callbacks. It takes no
     226    // arguments, and ignores any that may be present.
     227    void dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
     228
     229    // If true, causes provisional frame loads to be stopped for the remainder of
     230    // the test.
     231    void setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant*);
     232
     233    void dumpTitleChanges(const CppArgumentList&, CppVariant*);
     234
    213235    ///////////////////////////////////////////////////////////////////////////
    214236    // Methods interacting with the WebTestProxy
     
    245267    int numberOfActiveAnimations();
    246268
     269    bool m_testIsRunning;
     270
    247271    WebKit::WebURL m_userStyleSheetLocation;
    248272
     
    275299    bool m_dumpAsAudio;
    276300
     301    // If true, the test_shell will output a descriptive line for each frame
     302    // load callback.
     303    bool m_dumpFrameLoadCallbacks;
     304
     305    // If true, the test_shell will output a line of the user gesture status
     306    // text for some frame load callbacks.
     307    bool m_dumpUserGestureInFrameLoadCallbacks;
     308
     309    // If true, stops provisional frame loads during the
     310    // DidStartProvisionalLoadForFrame callback.
     311    bool m_stopProvisionalFrameLoads;
     312
     313    // If true, output a message when the page title is changed.
     314    bool m_dumpTitleChanges;
     315
    277316    // WAV audio data is stored here.
    278317    WebKit::WebArrayBufferView m_audioData;
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp

    r137993 r139090  
    3737#include "WebEventSender.h"
    3838#include "WebTestDelegate.h"
     39#include "WebTestRunner.h"
    3940
    4041using WebKit::WebContextMenuData;
     
    5455    TestInterfaces* testInterfaces() { return &m_interfaces; }
    5556    void setDelegate(WebTestDelegate*);
     57    void setWebView(WebView*);
     58    void setTestIsRunning(bool);
     59    WebView* webView() const { return m_webView; }
    5660    WebAccessibilityController* accessibilityController() { return &m_accessibilityController; }
    5761    WebEventSender* eventSender() { return &m_eventSender; }
     
    7579private:
    7680    TestInterfaces m_interfaces;
     81    bool m_testIsRunning;
     82    WebView* m_webView;
    7783    WebAccessibilityController m_accessibilityController;
    7884    WebEventSender m_eventSender;
     
    8288
    8389WebTestInterfaces::Internal::Internal()
    84     : m_accessibilityController(m_interfaces.accessibilityController())
     90    : m_testIsRunning(false)
     91    , m_webView(0)
     92    , m_accessibilityController(m_interfaces.accessibilityController())
    8593    , m_eventSender(m_interfaces.eventSender())
    8694    , m_testRunner(0)
     
    104112}
    105113
     114void WebTestInterfaces::Internal::setWebView(WebView* webView)
     115{
     116    m_webView = webView;
     117    m_interfaces.setWebView(webView);
     118}
     119
     120void WebTestInterfaces::Internal::setTestIsRunning(bool running)
     121{
     122    if (m_testRunner)
     123        m_testRunner->setTestIsRunning(running);
     124}
     125
    106126void WebTestInterfaces::Internal::clearContextMenuData()
    107127{
     
    176196void WebTestInterfaces::setWebView(WebView* webView)
    177197{
    178     m_internal->testInterfaces()->setWebView(webView);
     198    m_internal->setWebView(webView);
    179199}
    180200
     
    194214}
    195215
     216void WebTestInterfaces::setTestIsRunning(bool running)
     217{
     218    m_internal->setTestIsRunning(running);
     219}
     220
     221WebView* WebTestInterfaces::webView() const
     222{
     223    return m_internal->webView();
     224}
     225
    196226WebAccessibilityController* WebTestInterfaces::accessibilityController()
    197227{
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp

    r138239 r139090  
    3737#include "WebElement.h"
    3838#include "WebEventSender.h"
     39#include "WebFrame.h"
    3940#include "WebIntent.h"
    4041#include "WebIntentRequest.h"
     
    4546#include "WebTestInterfaces.h"
    4647#include "WebTestRunner.h"
     48#include "WebView.h"
    4749#include "platform/WebCString.h"
    4850#include <wtf/StringExtras.h>
     
    115117}
    116118
     119void printFrameDescription(WebTestDelegate* delegate, WebFrame* frame)
     120{
     121    string name8 = frame->uniqueName().utf8();
     122    if (frame == frame->view()->mainFrame()) {
     123        if (!name8.length()) {
     124            delegate->printMessage("main frame");
     125            return;
     126        }
     127        delegate->printMessage(string("main frame \"") + name8 + "\"");
     128        return;
     129    }
     130    if (!name8.length()) {
     131        delegate->printMessage("frame (anonymous)");
     132        return;
     133    }
     134    delegate->printMessage(string("frame \"") + name8 + "\"");
     135}
     136
     137void printFrameUserGestureStatus(WebTestDelegate* delegate, WebFrame* frame, const char* msg)
     138{
     139    bool isUserGesture = frame->isProcessingUserGesture();
     140    delegate->printMessage(string("Frame with user gesture \"") + (isUserGesture ? "true" : "false") + "\"" + msg);
     141}
     142
    117143}
    118144
     
    427453}
    428454
    429 }
     455void WebTestProxyBase::willPerformClientRedirect(WebFrame* frame, const WebURL&, const WebURL& to, double, double)
     456{
     457    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     458        printFrameDescription(m_delegate, frame);
     459        m_delegate->printMessage(string(" - willPerformClientRedirectToURL: ") + to.spec().data() + " \n");
     460    }
     461
     462    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpUserGestureInFrameLoadCallbacks())
     463        printFrameUserGestureStatus(m_delegate, frame, " - in willPerformClientRedirect\n");
     464}
     465
     466void WebTestProxyBase::didCancelClientRedirect(WebFrame* frame)
     467{
     468    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     469        printFrameDescription(m_delegate, frame);
     470        m_delegate->printMessage(" - didCancelClientRedirectForFrame\n");
     471    }
     472}
     473
     474void WebTestProxyBase::didStartProvisionalLoad(WebFrame* frame)
     475{
     476    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     477        printFrameDescription(m_delegate, frame);
     478        m_delegate->printMessage(" - didStartProvisionalLoadForFrame\n");
     479    }
     480
     481    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpUserGestureInFrameLoadCallbacks())
     482        printFrameUserGestureStatus(m_delegate, frame, " - in didStartProvisionalLoadForFrame\n");
     483
     484    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->stopProvisionalFrameLoads()) {
     485        printFrameDescription(m_delegate, frame);
     486        m_delegate->printMessage(" - stopping load in didStartProvisionalLoadForFrame callback\n");
     487        frame->stopLoading();
     488    }
     489}
     490
     491void WebTestProxyBase::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame)
     492{
     493    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     494        printFrameDescription(m_delegate, frame);
     495        m_delegate->printMessage(" - didReceiveServerRedirectForProvisionalLoadForFrame\n");
     496    }
     497}
     498
     499void WebTestProxyBase::didFailProvisionalLoad(WebFrame* frame, const WebURLError&)
     500{
     501    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     502        printFrameDescription(m_delegate, frame);
     503        m_delegate->printMessage(" - didFailProvisionalLoadWithError\n");
     504    }
     505}
     506
     507void WebTestProxyBase::didCommitProvisionalLoad(WebFrame* frame, bool)
     508{
     509    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     510        printFrameDescription(m_delegate, frame);
     511        m_delegate->printMessage(" - didCommitLoadForFrame\n");
     512    }
     513}
     514
     515void WebTestProxyBase::didReceiveTitle(WebFrame* frame, const WebString& title, WebTextDirection)
     516{
     517    WebCString title8 = title.utf8();
     518
     519    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     520        printFrameDescription(m_delegate, frame);
     521        m_delegate->printMessage(string(" - didReceiveTitle: ") + title8.data() + "\n");
     522    }
     523
     524    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpTitleChanges())
     525        m_delegate->printMessage(string("TITLE CHANGED: '") + title8.data() + "'\n");
     526
     527}
     528
     529void WebTestProxyBase::didFinishDocumentLoad(WebFrame* frame)
     530{
     531    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     532        printFrameDescription(m_delegate, frame);
     533        m_delegate->printMessage(" - didFinishDocumentLoadForFrame\n");
     534    } else {
     535        unsigned pendingUnloadEvents = frame->unloadListenerCount();
     536        if (pendingUnloadEvents) {
     537            printFrameDescription(m_delegate, frame);
     538            char buffer[100];
     539            snprintf(buffer, sizeof(buffer), " - has %u onunload handler(s)\n", pendingUnloadEvents);
     540            m_delegate->printMessage(buffer);
     541        }
     542    }
     543}
     544
     545void WebTestProxyBase::didHandleOnloadEvents(WebFrame* frame)
     546{
     547    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     548        printFrameDescription(m_delegate, frame);
     549        m_delegate->printMessage(" - didHandleOnloadEventsForFrame\n");
     550    }
     551}
     552
     553void WebTestProxyBase::didFailLoad(WebFrame* frame, const WebURLError&)
     554{
     555    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     556        printFrameDescription(m_delegate, frame);
     557        m_delegate->printMessage(" - didFailLoadWithError\n");
     558    }
     559}
     560
     561void WebTestProxyBase::didFinishLoad(WebFrame* frame)
     562{
     563    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     564        printFrameDescription(m_delegate, frame);
     565        m_delegate->printMessage(" - didFinishLoadForFrame\n");
     566    }
     567}
     568
     569void WebTestProxyBase::didChangeLocationWithinPage(WebFrame* frame)
     570{
     571    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks()) {
     572        printFrameDescription(m_delegate, frame);
     573        m_delegate->printMessage(" - didChangeLocationWithinPageForFrame\n");
     574    }
     575}
     576
     577void WebTestProxyBase::didDisplayInsecureContent(WebFrame*)
     578{
     579    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks())
     580        m_delegate->printMessage("didDisplayInsecureContent\n");
     581}
     582
     583void WebTestProxyBase::didRunInsecureContent(WebFrame*, const WebSecurityOrigin&, const WebURL&)
     584{
     585    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks())
     586        m_delegate->printMessage("didRunInsecureContent\n");
     587}
     588
     589void WebTestProxyBase::didDetectXSS(WebFrame*, const WebURL&, bool)
     590{
     591    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpFrameLoadCallbacks())
     592        m_delegate->printMessage("didDetectXSS\n");
     593}
     594
     595}
  • trunk/Tools/DumpRenderTree/chromium/TestShell.cpp

    r138993 r139090  
    258258    m_dumpPixelsForCurrentTest = shouldDumpPixels;
    259259    m_testIsPreparing = true;
     260    m_testInterfaces->setTestIsRunning(true);
    260261    m_params = params;
    261262    string testUrl = m_params.testUrl.spec();
     
    390391        return;
    391392    m_testIsPending = false;
     393    m_testInterfaces->setTestIsRunning(false);
    392394    if (m_dumpWhenFinished)
    393395        dump();
  • trunk/Tools/DumpRenderTree/chromium/TestShell.h

    r137710 r139090  
    112112
    113113    void setFocus(WebKit::WebWidget*, bool enable);
    114     bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpFrameLoadCallbacks(); }
    115114    bool shouldDumpResourceRequestCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceRequestCallbacks(); }
    116     bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpUserGestureInFrameLoadCallbacks(); }
    117115    bool shouldDumpResourceLoadCallbacks() const  { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceLoadCallbacks(); }
    118116    bool shouldDumpResourceResponseMIMETypes() const  { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceResponseMIMETypes(); }
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp

    r137997 r139090  
    855855}
    856856
    857 void WebViewHost::willPerformClientRedirect(WebFrame* frame, const WebURL& from, const WebURL& to,
    858                                             double interval, double fire_time)
    859 {
    860     if (m_shell->shouldDumpFrameLoadCallbacks()) {
    861         printFrameDescription(frame);
    862         printf(" - willPerformClientRedirectToURL: %s \n", to.spec().data());
    863     }
    864 
    865     if (m_shell->shouldDumpUserGestureInFrameLoadCallbacks())
    866         printFrameUserGestureStatus(frame, " - in willPerformClientRedirect\n");
    867 }
    868 
    869 void WebViewHost::didCancelClientRedirect(WebFrame* frame)
    870 {
    871     if (!m_shell->shouldDumpFrameLoadCallbacks())
    872         return;
    873     printFrameDescription(frame);
    874     fputs(" - didCancelClientRedirectForFrame\n", stdout);
    875 }
    876 
    877857void WebViewHost::didCreateDataSource(WebFrame*, WebDataSource* ds)
    878858{
     
    884864void WebViewHost::didStartProvisionalLoad(WebFrame* frame)
    885865{
    886     if (m_shell->shouldDumpFrameLoadCallbacks()) {
    887         printFrameDescription(frame);
    888         fputs(" - didStartProvisionalLoadForFrame\n", stdout);
    889     }
    890 
    891     if (m_shell->shouldDumpUserGestureInFrameLoadCallbacks())
    892         printFrameUserGestureStatus(frame, " - in didStartProvisionalLoadForFrame\n");
    893 
    894866    if (!m_topLoadingFrame)
    895867        m_topLoadingFrame = frame;
    896868
    897     if (testRunner()->stopProvisionalFrameLoads()) {
    898         printFrameDescription(frame);
    899         fputs(" - stopping load in didStartProvisionalLoadForFrame callback\n", stdout);
    900         frame->stopLoading();
    901     }
    902869    updateAddressBar(frame->view());
    903870}
     
    905872void WebViewHost::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame)
    906873{
    907     if (m_shell->shouldDumpFrameLoadCallbacks()) {
    908         printFrameDescription(frame);
    909         fputs(" - didReceiveServerRedirectForProvisionalLoadForFrame\n", stdout);
    910     }
    911874    updateAddressBar(frame->view());
    912875}
     
    914877void WebViewHost::didFailProvisionalLoad(WebFrame* frame, const WebURLError& error)
    915878{
    916     if (m_shell->shouldDumpFrameLoadCallbacks()) {
    917         printFrameDescription(frame);
    918         fputs(" - didFailProvisionalLoadWithError\n", stdout);
    919     }
    920 
    921879    locationChangeDone(frame);
    922880
     
    927885void WebViewHost::didCommitProvisionalLoad(WebFrame* frame, bool isNewNavigation)
    928886{
    929     if (m_shell->shouldDumpFrameLoadCallbacks()) {
    930         printFrameDescription(frame);
    931         fputs(" - didCommitLoadForFrame\n", stdout);
    932     }
    933887    updateForCommittedLoad(frame, isNewNavigation);
    934888}
     
    941895void WebViewHost::didReceiveTitle(WebFrame* frame, const WebString& title, WebTextDirection direction)
    942896{
    943     WebCString title8 = title.utf8();
    944 
    945     if (m_shell->shouldDumpFrameLoadCallbacks()) {
    946         printFrameDescription(frame);
    947         printf(" - didReceiveTitle: %s\n", title8.data());
    948     }
    949 
    950     if (testRunner()->shouldDumpTitleChanges())
    951         printf("TITLE CHANGED: '%s'\n", title8.data());
    952 
    953897    setPageTitle(title);
    954898    testRunner()->setTitleTextDirection(direction);
    955899}
    956900
    957 void WebViewHost::didFinishDocumentLoad(WebFrame* frame)
    958 {
    959     if (m_shell->shouldDumpFrameLoadCallbacks()) {
    960         printFrameDescription(frame);
    961         fputs(" - didFinishDocumentLoadForFrame\n", stdout);
    962     } else {
    963         unsigned pendingUnloadEvents = frame->unloadListenerCount();
    964         if (pendingUnloadEvents) {
    965             printFrameDescription(frame);
    966             printf(" - has %u onunload handler(s)\n", pendingUnloadEvents);
    967         }
    968     }
    969 }
    970 
    971 void WebViewHost::didHandleOnloadEvents(WebFrame* frame)
    972 {
    973     if (m_shell->shouldDumpFrameLoadCallbacks()) {
    974         printFrameDescription(frame);
    975         fputs(" - didHandleOnloadEventsForFrame\n", stdout);
    976     }
    977 }
    978 
    979901void WebViewHost::didFailLoad(WebFrame* frame, const WebURLError& error)
    980902{
    981     if (m_shell->shouldDumpFrameLoadCallbacks()) {
    982         printFrameDescription(frame);
    983         fputs(" - didFailLoadWithError\n", stdout);
    984     }
    985903    locationChangeDone(frame);
    986904}
     
    988906void WebViewHost::didFinishLoad(WebFrame* frame)
    989907{
    990     if (m_shell->shouldDumpFrameLoadCallbacks()) {
    991         printFrameDescription(frame);
    992         fputs(" - didFinishLoadForFrame\n", stdout);
    993     }
    994908    updateAddressBar(frame->view());
    995909    locationChangeDone(frame);
     
    1001915
    1002916    updateForCommittedLoad(frame, isNewNavigation);
    1003 }
    1004 
    1005 void WebViewHost::didChangeLocationWithinPage(WebFrame* frame)
    1006 {
    1007     if (m_shell->shouldDumpFrameLoadCallbacks()) {
    1008         printFrameDescription(frame);
    1009         fputs(" - didChangeLocationWithinPageForFrame\n", stdout);
    1010     }
    1011917}
    1012918
     
    11421048    }
    11431049    removeIdentifierForRequest(identifier);
    1144 }
    1145 
    1146 void WebViewHost::didDisplayInsecureContent(WebFrame*)
    1147 {
    1148     if (m_shell->shouldDumpFrameLoadCallbacks())
    1149         fputs("didDisplayInsecureContent\n", stdout);
    1150 }
    1151 
    1152 void WebViewHost::didRunInsecureContent(WebFrame*, const WebSecurityOrigin& origin, const WebURL& insecureURL)
    1153 {
    1154     if (m_shell->shouldDumpFrameLoadCallbacks())
    1155         fputs("didRunInsecureContent\n", stdout);
    1156 }
    1157 
    1158 void WebViewHost::didDetectXSS(WebFrame*, const WebURL&, bool)
    1159 {
    1160     if (m_shell->shouldDumpFrameLoadCallbacks())
    1161         fputs("didDetectXSS\n", stdout);
    11621050}
    11631051
     
    15901478}
    15911479
    1592 void WebViewHost::printFrameUserGestureStatus(WebFrame* webframe, const char* msg)
    1593 {
    1594     bool isUserGesture = webframe->isProcessingUserGesture();
    1595     printf("Frame with user gesture \"%s\"%s", isUserGesture ? "true" : "false", msg);
    1596 }
    1597 
    15981480void WebViewHost::printResourceDescription(unsigned identifier)
    15991481{
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.h

    r137997 r139090  
    245245    virtual WebKit::WebURLError cancelledError(WebKit::WebFrame*, const WebKit::WebURLRequest&);
    246246    virtual void unableToImplementPolicyWithError(WebKit::WebFrame*, const WebKit::WebURLError&);
    247     virtual void willPerformClientRedirect(
    248         WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to,
    249         double interval, double fireTime);
    250     virtual void didCancelClientRedirect(WebKit::WebFrame*);
    251247    virtual void didCreateDataSource(WebKit::WebFrame*, WebKit::WebDataSource*);
    252248    virtual void didStartProvisionalLoad(WebKit::WebFrame*);
     
    256252    virtual void didClearWindowObject(WebKit::WebFrame*);
    257253    virtual void didReceiveTitle(WebKit::WebFrame*, const WebKit::WebString&, WebKit::WebTextDirection);
    258     virtual void didFinishDocumentLoad(WebKit::WebFrame*);
    259     virtual void didHandleOnloadEvents(WebKit::WebFrame*);
    260254    virtual void didFailLoad(WebKit::WebFrame*, const WebKit::WebURLError&);
    261255    virtual void didFinishLoad(WebKit::WebFrame*);
    262256    virtual void didNavigateWithinPage(WebKit::WebFrame*, bool isNewNavigation);
    263     virtual void didChangeLocationWithinPage(WebKit::WebFrame*);
    264257    virtual void assignIdentifierToRequest(WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLRequest&);
    265258    virtual void removeIdentifierForRequest(unsigned identifier);
     
    269262    virtual void didFinishResourceLoad(WebKit::WebFrame*, unsigned identifier);
    270263    virtual void didFailResourceLoad(WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLError&);
    271     virtual void didDisplayInsecureContent(WebKit::WebFrame*);
    272     virtual void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&, const WebKit::WebURL&);
    273     virtual void didDetectXSS(WebKit::WebFrame*, const WebKit::WebURL&, bool didBlockEntirePage);
    274264    virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*);
    275265    virtual void deleteFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, WebKit::WebFileSystemCallbacks*);
     
    335325    void printFrameDescription(WebKit::WebFrame*);
    336326
    337     // Dumping the user gesture status to the console.
    338     void printFrameUserGestureStatus(WebKit::WebFrame*, const char*);
    339 
    340327    bool hasWindow() const { return m_hasWindow; }
    341328    void resetScrollRect();
Note: See TracChangeset for help on using the changeset viewer.