Changeset 139627 in webkit


Ignore:
Timestamp:
Jan 14, 2013 11:04:39 AM (11 years ago)
Author:
jochen@chromium.org
Message:

[chromium] move remaining methods to dump WebViewClient callbacks to TestRunner library
https://bugs.webkit.org/show_bug.cgi?id=106785

Reviewed by Adam Barth.

  • DumpRenderTree/chromium/DRTTestRunner.cpp:

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

  • DumpRenderTree/chromium/DRTTestRunner.h:

(DRTTestRunner):

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

(WebTestProxyBase):
(WebTestRunner::WebTestProxy::setStatusText):
(WebTestRunner::WebTestProxy::didStopLoading):

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

(WebTestRunner::WebTestRunner::shouldDumpStatusCallbacks):
(WebTestRunner::WebTestRunner::shouldDumpProgressFinishedCallback):

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

(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::reset):
(WebTestRunner::TestRunner::shouldDumpStatusCallbacks):
(WebTestRunner):
(WebTestRunner::TestRunner::shouldDumpProgressFinishedCallback):
(WebTestRunner::TestRunner::dumpWindowStatusChanges):
(WebTestRunner::TestRunner::dumpProgressFinishedCallback):

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

(TestRunner):

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

(WebTestRunner::WebTestProxyBase::setStatusText):
(WebTestRunner):
(WebTestRunner::WebTestProxyBase::didStopLoading):

  • DumpRenderTree/chromium/WebViewHost.cpp:

(WebViewHost::didStopLoading):

  • DumpRenderTree/chromium/WebViewHost.h:

(WebViewHost):

Location:
trunk/Tools
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r139613 r139627  
     12013-01-14  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] move remaining methods to dump WebViewClient callbacks to TestRunner library
     4        https://bugs.webkit.org/show_bug.cgi?id=106785
     5
     6        Reviewed by Adam Barth.
     7
     8        * DumpRenderTree/chromium/DRTTestRunner.cpp:
     9        (DRTTestRunner::DRTTestRunner):
     10        (DRTTestRunner::reset):
     11        * DumpRenderTree/chromium/DRTTestRunner.h:
     12        (DRTTestRunner):
     13        * DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
     14        (WebTestProxyBase):
     15        (WebTestRunner::WebTestProxy::setStatusText):
     16        (WebTestRunner::WebTestProxy::didStopLoading):
     17        * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
     18        (WebTestRunner::WebTestRunner::shouldDumpStatusCallbacks):
     19        (WebTestRunner::WebTestRunner::shouldDumpProgressFinishedCallback):
     20        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
     21        (WebTestRunner::TestRunner::TestRunner):
     22        (WebTestRunner::TestRunner::reset):
     23        (WebTestRunner::TestRunner::shouldDumpStatusCallbacks):
     24        (WebTestRunner):
     25        (WebTestRunner::TestRunner::shouldDumpProgressFinishedCallback):
     26        (WebTestRunner::TestRunner::dumpWindowStatusChanges):
     27        (WebTestRunner::TestRunner::dumpProgressFinishedCallback):
     28        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
     29        (TestRunner):
     30        * DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
     31        (WebTestRunner::WebTestProxyBase::setStatusText):
     32        (WebTestRunner):
     33        (WebTestRunner::WebTestProxyBase::didStopLoading):
     34        * DumpRenderTree/chromium/WebViewHost.cpp:
     35        (WebViewHost::didStopLoading):
     36        * DumpRenderTree/chromium/WebViewHost.h:
     37        (WebViewHost):
     38
    1392013-01-14  Andrey Lushnikov  <lushnikov@chromium.org>
    240
  • trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp

    r139549 r139627  
    116116    bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion);
    117117    bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList);
    118     bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback);
    119118    bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect);
    120     bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges);
    121119#if ENABLE(NOTIFICATIONS)
    122120    bindMethod("grantWebNotificationPermission", &DRTTestRunner::grantWebNotificationPermission);
     
    228226}
    229227
    230 void DRTTestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result)
    231 {
    232     m_dumpProgressFinishedCallback = true;
    233     result->setNull();
    234 }
    235 
    236 void DRTTestRunner::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result)
    237 {
    238     m_dumpWindowStatusChanges = true;
    239     result->setNull();
    240 }
    241 
    242228void DRTTestRunner::waitUntilDone(const CppArgumentList&, CppVariant* result)
    243229{
     
    424410    if (m_shell)
    425411        m_shell->webViewHost()->setDeviceScaleFactor(1);
    426     m_dumpProgressFinishedCallback = false;
    427412    m_dumpBackForwardList = false;
    428     m_dumpWindowStatusChanges = false;
    429413    m_dumpSelectionRect = false;
    430414    m_waitUntilDone = false;
  • trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h

    r139549 r139627  
    7676    virtual ~DRTTestRunner();
    7777
    78     // This function sets a flag that tells the test_shell to print a line of
    79     // descriptive text for the progress finished callback. It takes no
    80     // arguments, and ignores any that may be present.
    81     void dumpProgressFinishedCallback(const CppArgumentList&, CppVariant*);
    82 
    8378    // This function sets a flag that tells the test_shell to print out a text
    8479    // representation of the back/forward list. It ignores all arguments.
    8580    void dumpBackForwardList(const CppArgumentList&, CppVariant*);
    86 
    87     // This function sets a flag that tells the test_shell to dump all calls
    88     // to window.status().
    89     // It takes no arguments, and ignores any that may be present.
    90     void dumpWindowStatusChanges(const CppArgumentList&, CppVariant*);
    9181
    9282    // Functions for dealing with windows. By default we block all new windows.
     
    203193    void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
    204194
    205     bool shouldDumpProgressFinishedCallback() { return m_dumpProgressFinishedCallback; }
    206     void setShouldDumpProgressFinishedCallback(bool value) { m_dumpProgressFinishedCallback = value; }
    207     bool shouldDumpStatusCallbacks() { return m_dumpWindowStatusChanges; }
    208195    bool shouldDumpSelectionRect() { return m_dumpSelectionRect; }
    209196    bool shouldDumpBackForwardList() { return m_dumpBackForwardList; }
     
    301288    bool m_dumpSelectionRect;
    302289
    303     // If true, the test_shell will output a descriptive line for the progress
    304     // finished callback.
    305     bool m_dumpProgressFinishedCallback;
    306 
    307290    // If true, the test_shell will produce a dump of the back forward list as
    308291    // well.
    309292    bool m_dumpBackForwardList;
    310 
    311     // If true, the test_shell will dump all changes to window.status.
    312     bool m_dumpWindowStatusChanges;
    313293
    314294    // When reset is called, go through and close all but the main test shell
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h

    r139234 r139627  
    108108    void dispatchIntent(WebKit::WebFrame* source, const WebKit::WebIntentRequest&);
    109109    WebKit::WebView* createView(WebKit::WebFrame* creator, const WebKit::WebURLRequest&, const WebKit::WebWindowFeatures&, const WebKit::WebString& frameName, WebKit::WebNavigationPolicy);
     110    void setStatusText(const WebKit::WebString&);
     111    void didStopLoading();
     112
    110113    void willPerformClientRedirect(WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to, double interval, double fire_time);
    111114    void didCancelClientRedirect(WebKit::WebFrame*);
     
    266269        return Base::createView(creator, request, features, frameName, policy);
    267270    }
     271    virtual void setStatusText(const WebKit::WebString& text)
     272    {
     273        WebTestProxyBase::setStatusText(text);
     274        Base::setStatusText(text);
     275    }
     276    virtual void didStopLoading()
     277    {
     278        WebTestProxyBase::didStopLoading();
     279        Base::didStopLoading();
     280    }
    268281
    269282    // WebFrameClient implementation.
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h

    r139355 r139627  
    6464    virtual bool shouldDumpResourceResponseMIMETypes() const { return false; }
    6565    virtual WebKit::WebPermissionClient* webPermissions() const { return 0; }
     66    virtual bool shouldDumpStatusCallbacks() const { return false; }
     67    virtual bool shouldDumpProgressFinishedCallback() const { return false; }
    6668};
    6769
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp

    r139549 r139627  
    161161    bindMethod("setAllowDisplayOfInsecureContent", &TestRunner::setAllowDisplayOfInsecureContent);
    162162    bindMethod("setAllowRunningOfInsecureContent", &TestRunner::setAllowRunningOfInsecureContent);
     163    bindMethod("dumpStatusCallbacks", &TestRunner::dumpWindowStatusChanges);
     164    bindMethod("dumpProgressFinishedCallback", &TestRunner::dumpProgressFinishedCallback);
    163165
    164166    // The following methods interact with the WebTestProxy.
     
    251253    m_dumpResourceRequestCallbacks = false;
    252254    m_dumpResourceResponseMIMETypes = false;
     255    m_dumpWindowStatusChanges = false;
     256    m_dumpProgressFinishedCallback = false;
    253257
    254258    m_globalFlag.set(false);
     
    365369}
    366370
     371bool TestRunner::shouldDumpStatusCallbacks() const
     372{
     373    return m_dumpWindowStatusChanges;
     374}
     375
     376bool TestRunner::shouldDumpProgressFinishedCallback() const
     377{
     378    return m_dumpProgressFinishedCallback;
     379}
     380
    367381void TestRunner::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result)
    368382{
     
    412426        m_webPermissions->setRunningInsecureContentAllowed(arguments[0].value.boolValue);
    413427
     428    result->setNull();
     429}
     430
     431void TestRunner::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result)
     432{
     433    m_dumpWindowStatusChanges = true;
     434    result->setNull();
     435}
     436
     437void TestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result)
     438{
     439    m_dumpProgressFinishedCallback = true;
    414440    result->setNull();
    415441}
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h

    r139549 r139627  
    8282    virtual bool shouldDumpResourceResponseMIMETypes() const OVERRIDE;
    8383    virtual WebKit::WebPermissionClient* webPermissions() const OVERRIDE;
     84    virtual bool shouldDumpStatusCallbacks() const OVERRIDE;
     85    virtual bool shouldDumpProgressFinishedCallback() const OVERRIDE;
    8486
    8587protected:
     
    279281    void dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant*);
    280282
     283    // This function sets a flag that tells the test_shell to dump all calls
     284    // to window.status().
     285    // It takes no arguments, and ignores any that may be present.
     286    void dumpWindowStatusChanges(const CppArgumentList&, CppVariant*);
     287
     288    // This function sets a flag that tells the test_shell to print a line of
     289    // descriptive text for the progress finished callback. It takes no
     290    // arguments, and ignores any that may be present.
     291    void dumpProgressFinishedCallback(const CppArgumentList&, CppVariant*);
     292
    281293    ///////////////////////////////////////////////////////////////////////////
    282294    // Methods interacting with the WebTestProxy
     
    391403    bool m_dumpResourceResponseMIMETypes;
    392404
     405    // If true, the test_shell will dump all changes to window.status.
     406    bool m_dumpWindowStatusChanges;
     407
     408    // If true, the test_shell will output a descriptive line for the progress
     409    // finished callback.
     410    bool m_dumpProgressFinishedCallback;
     411
    393412    // WAV audio data is stored here.
    394413    WebKit::WebArrayBufferView m_audioData;
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp

    r139234 r139627  
    508508}
    509509
     510void WebTestProxyBase::setStatusText(const WebString& text)
     511{
     512    if (!m_testInterfaces->testRunner() || !m_testInterfaces->testRunner()->shouldDumpStatusCallbacks())
     513        return;
     514    m_delegate->printMessage(string("UI DELEGATE STATUS CALLBACK: setStatusText:") + text.utf8().data() + "\n");
     515}
     516
     517void WebTestProxyBase::didStopLoading()
     518{
     519    if (m_testInterfaces->testRunner() && m_testInterfaces->testRunner()->shouldDumpProgressFinishedCallback())
     520        m_delegate->printMessage("postProgressFinishedNotification\n");
     521}
     522
    510523void WebTestProxyBase::willPerformClientRedirect(WebFrame* frame, const WebURL&, const WebURL& to, double, double)
    511524{
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp

    r139549 r139627  
    249249void WebViewHost::didStopLoading()
    250250{
    251     if (testRunner()->shouldDumpProgressFinishedCallback())
    252         fputs("postProgressFinishedNotification\n", stdout);
    253251    m_shell->setIsLoading(false);
    254252}
     
    426424{
    427425    m_lastContextMenuData = adoptPtr(new WebContextMenuData(contextMenuData));
    428 }
    429 
    430 void WebViewHost::setStatusText(const WebString& text)
    431 {
    432     if (!testRunner()->shouldDumpStatusCallbacks())
    433         return;
    434     // When running tests, write to stdout.
    435     printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text.utf8().data());
    436426}
    437427
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.h

    r139549 r139627  
    192192    virtual bool runModalBeforeUnloadDialog(WebKit::WebFrame*, const WebKit::WebString&);
    193193    virtual void showContextMenu(WebKit::WebFrame*, const WebKit::WebContextMenuData&);
    194     virtual void setStatusText(const WebKit::WebString&);
    195194    virtual void didUpdateLayout();
    196195    virtual void navigateBackForwardSoon(int offset);
Note: See TracChangeset for help on using the changeset viewer.