Changeset 138980 in webkit


Ignore:
Timestamp:
Jan 7, 2013 1:21:28 PM (11 years ago)
Author:
jochen@chromium.org
Message:

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

Reviewed by Adam Barth.

This moves dumpAsText, dumpChildFramesAsText, and dumpChildFrameScrollPositions to the TestRunner library.

  • DumpRenderTree/chromium/DRTTestRunner.cpp:

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

  • DumpRenderTree/chromium/DRTTestRunner.h:

(DRTTestRunner):

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

(WebTestRunner::WebTestRunner::shouldDumpAsText):
(WebTestRunner::WebTestRunner::setShouldDumpAsText):
(WebTestRunner::WebTestRunner::shouldGeneratePixelResults):
(WebTestRunner::WebTestRunner::setShouldGeneratePixelResults):
(WebTestRunner::WebTestRunner::shouldDumpChildFrameScrollPositions):
(WebTestRunner::WebTestRunner::shouldDumpChildFramesAsText):

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

(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::reset):
(WebTestRunner::TestRunner::shouldDumpAsText):
(WebTestRunner):
(WebTestRunner::TestRunner::setShouldDumpAsText):
(WebTestRunner::TestRunner::shouldGeneratePixelResults):
(WebTestRunner::TestRunner::setShouldGeneratePixelResults):
(WebTestRunner::TestRunner::shouldDumpChildFrameScrollPositions):
(WebTestRunner::TestRunner::shouldDumpChildFramesAsText):
(WebTestRunner::TestRunner::dumpAsText):
(WebTestRunner::TestRunner::dumpChildFrameScrollPositions):
(WebTestRunner::TestRunner::dumpChildFramesAsText):

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

(TestRunner):

Location:
trunk/Tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r138965 r138980  
     12013-01-07  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] move dumpAsText and friends to the TestRunner library
     4        https://bugs.webkit.org/show_bug.cgi?id=106222
     5
     6        Reviewed by Adam Barth.
     7
     8        This moves dumpAsText, dumpChildFramesAsText, and dumpChildFrameScrollPositions to the TestRunner library.
     9
     10        * DumpRenderTree/chromium/DRTTestRunner.cpp:
     11        (DRTTestRunner::DRTTestRunner):
     12        (DRTTestRunner::reset):
     13        * DumpRenderTree/chromium/DRTTestRunner.h:
     14        (DRTTestRunner):
     15        * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
     16        (WebTestRunner::WebTestRunner::shouldDumpAsText):
     17        (WebTestRunner::WebTestRunner::setShouldDumpAsText):
     18        (WebTestRunner::WebTestRunner::shouldGeneratePixelResults):
     19        (WebTestRunner::WebTestRunner::setShouldGeneratePixelResults):
     20        (WebTestRunner::WebTestRunner::shouldDumpChildFrameScrollPositions):
     21        (WebTestRunner::WebTestRunner::shouldDumpChildFramesAsText):
     22        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
     23        (WebTestRunner::TestRunner::TestRunner):
     24        (WebTestRunner::TestRunner::reset):
     25        (WebTestRunner::TestRunner::shouldDumpAsText):
     26        (WebTestRunner):
     27        (WebTestRunner::TestRunner::setShouldDumpAsText):
     28        (WebTestRunner::TestRunner::shouldGeneratePixelResults):
     29        (WebTestRunner::TestRunner::setShouldGeneratePixelResults):
     30        (WebTestRunner::TestRunner::shouldDumpChildFrameScrollPositions):
     31        (WebTestRunner::TestRunner::shouldDumpChildFramesAsText):
     32        (WebTestRunner::TestRunner::dumpAsText):
     33        (WebTestRunner::TestRunner::dumpChildFrameScrollPositions):
     34        (WebTestRunner::TestRunner::dumpChildFramesAsText):
     35        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
     36        (TestRunner):
     37
    1382013-01-07  Ryosuke Niwa  <rniwa@webkit.org>
    239
  • trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp

    r137997 r138980  
    118118    bindMethod("display", &DRTTestRunner::display);
    119119    bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion);
    120     bindMethod("dumpAsText", &DRTTestRunner::dumpAsText);
    121120    bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList);
    122     bindMethod("dumpChildFramesAsText", &DRTTestRunner::dumpChildFramesAsText);
    123     bindMethod("dumpChildFrameScrollPositions", &DRTTestRunner::dumpChildFrameScrollPositions);
    124121    bindMethod("dumpFrameLoadCallbacks", &DRTTestRunner::dumpFrameLoadCallbacks);
    125122    bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback);
     
    250247}
    251248
    252 void DRTTestRunner::dumpAsText(const CppArgumentList& arguments, CppVariant* result)
    253 {
    254     m_dumpAsText = true;
    255     m_generatePixelResults = false;
    256 
    257     // Optional paramater, describing whether it's allowed to dump pixel results in dumpAsText mode.
    258     if (arguments.size() > 0 && arguments[0].isBool())
    259         m_generatePixelResults = arguments[0].value.boolValue;
    260 
    261     result->setNull();
    262 }
    263 
    264249void DRTTestRunner::dumpBackForwardList(const CppArgumentList&, CppVariant* result)
    265250{
     
    301286{
    302287    m_dumpResourceResponseMIMETypes = true;
    303     result->setNull();
    304 }
    305 
    306 void DRTTestRunner::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result)
    307 {
    308     m_dumpChildFrameScrollPositions = true;
    309     result->setNull();
    310 }
    311 
    312 void DRTTestRunner::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result)
    313 {
    314     m_dumpChildFramesAsText = true;
    315288    result->setNull();
    316289}
     
    524497    if (m_shell)
    525498        m_shell->webViewHost()->setDeviceScaleFactor(1);
    526     m_dumpAsText = false;
    527499    m_dumpAsAudio = false;
    528500    m_dumpCreateView = false;
     
    534506    m_dumpResourceResponseMIMETypes = false;
    535507    m_dumpBackForwardList = false;
    536     m_dumpChildFrameScrollPositions = false;
    537     m_dumpChildFramesAsText = false;
    538508    m_dumpWindowStatusChanges = false;
    539509    m_dumpSelectionRect = false;
    540510    m_dumpTitleChanges = false;
    541511    m_dumpPermissionClientCallbacks = false;
    542     m_generatePixelResults = true;
    543512    m_waitUntilDone = false;
    544513    m_canOpenWindows = false;
  • trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h

    r137997 r138980  
    7676    virtual ~DRTTestRunner();
    7777
    78     // This function sets a flag that tells the test_shell to dump pages as
    79     // plain text, rather than as a text representation of the renderer's state.
    80     // It takes an optional argument, whether to dump pixels results or not.
    81     void dumpAsText(const CppArgumentList&, CppVariant*);
    82 
    8378    // This function sets a flag that tells the test_shell to print a line of
    8479    // descriptive text for each frame load callback. It takes no arguments, and
     
    10095    void dumpBackForwardList(const CppArgumentList&, CppVariant*);
    10196
    102     // This function sets a flag that tells the test_shell to print out the
    103     // scroll offsets of the child frames. It ignores all.
    104     void dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant*);
    105 
    106     // This function sets a flag that tells the test_shell to recursively
    107     // dump all frames as plain text if the dumpAsText flag is set.
    108     // It takes no arguments, and ignores any that may be present.
    109     void dumpChildFramesAsText(const CppArgumentList&, CppVariant*);
    110    
    11197    // This function sets a flag that tells the test_shell to dump a descriptive
    11298    // line for each resource load callback. It takes no arguments, and ignores
     
    283269    bool shouldDumpAsAudio() const { return m_dumpAsAudio; }
    284270    void setShouldDumpAsAudio(bool dumpAsAudio) { m_dumpAsAudio = dumpAsAudio; }
    285     bool shouldDumpAsText() { return m_dumpAsText; }
    286     void setShouldDumpAsText(bool value) { m_dumpAsText = value; }
    287271    bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
    288272    void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
     
    301285    bool shouldDumpTitleChanges() { return m_dumpTitleChanges; }
    302286    bool shouldDumpPermissionClientCallbacks() { return m_dumpPermissionClientCallbacks; }
    303     bool shouldDumpChildFrameScrollPositions() { return m_dumpChildFrameScrollPositions; }
    304     bool shouldDumpChildFramesAsText() { return m_dumpChildFramesAsText; }
    305     bool shouldGeneratePixelResults() { return m_generatePixelResults; }
    306     void setShouldGeneratePixelResults(bool value) { m_generatePixelResults = value; }
    307287    bool shouldDumpCreateView() { return m_dumpCreateView; }
    308288    bool canOpenWindows() { return m_canOpenWindows; }
     
    397377    TestShell* m_shell;
    398378
    399     // If true, the test_shell will produce a plain text dump rather than a
    400     // text representation of the renderer.
    401     bool m_dumpAsText;
    402 
    403379    // If true, the test_shell will output a base64 encoded WAVE file.
    404380    bool m_dumpAsAudio;
     
    436412    bool m_dumpBackForwardList;
    437413
    438     // If true, the test_shell will print out the child frame scroll offsets as
    439     // well.
    440     bool m_dumpChildFrameScrollPositions;
    441 
    442     // If true and if dump_as_text_ is true, the test_shell will recursively
    443     // dump all frames as plain text.
    444     bool m_dumpChildFramesAsText;
    445 
    446414    // If true, the test_shell will dump all changes to window.status.
    447415    bool m_dumpWindowStatusChanges;
     
    453421    // callback is invoked. Currently only implemented for allowImage.
    454422    bool m_dumpPermissionClientCallbacks;
    455 
    456     // If true, the test_shell will generate pixel results in dumpAsText mode
    457     bool m_generatePixelResults;
    458423
    459424    // If true, output a descriptive line each time WebViewClient::createView
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h

    r137993 r138980  
    3939public:
    4040    virtual bool shouldDumpEditingCallbacks() const { return false; }
     41    virtual bool shouldDumpAsText() const { return false; }
     42    virtual void setShouldDumpAsText(bool) { }
     43    virtual bool shouldGeneratePixelResults() const { return false; }
     44    virtual void setShouldGeneratePixelResults(bool) { }
     45    virtual bool shouldDumpChildFrameScrollPositions() const { return false; }
     46    virtual bool shouldDumpChildFramesAsText() const { return false; }
    4147};
    4248
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp

    r138814 r138980  
    134134    // The following modify the state of the TestRunner.
    135135    bindMethod("dumpEditingCallbacks", &TestRunner::dumpEditingCallbacks);
     136    bindMethod("dumpAsText", &TestRunner::dumpAsText);
     137    bindMethod("dumpChildFramesAsText", &TestRunner::dumpChildFramesAsText);
     138    bindMethod("dumpChildFrameScrollPositions", &TestRunner::dumpChildFrameScrollPositions);
    136139
    137140    // The following methods interact with the WebTestProxy.
     
    199202
    200203    m_dumpEditingCallbacks = false;
     204    m_dumpAsText = false;
     205    m_generatePixelResults = true;
     206    m_dumpChildFrameScrollPositions = false;
     207    m_dumpChildFramesAsText = false;
    201208
    202209    m_globalFlag.set(false);
     
    209216{
    210217    return m_dumpEditingCallbacks;
     218}
     219
     220bool TestRunner::shouldDumpAsText() const
     221{
     222    return m_dumpAsText;
     223}
     224
     225void TestRunner::setShouldDumpAsText(bool value)
     226{
     227    m_dumpAsText = value;
     228}
     229
     230bool TestRunner::shouldGeneratePixelResults() const
     231{
     232    return m_generatePixelResults;
     233}
     234
     235void TestRunner::setShouldGeneratePixelResults(bool value)
     236{
     237    m_generatePixelResults = value;
     238}
     239
     240bool TestRunner::shouldDumpChildFrameScrollPositions() const
     241{
     242    return m_dumpChildFrameScrollPositions;
     243}
     244
     245bool TestRunner::shouldDumpChildFramesAsText() const
     246{
     247    return m_dumpChildFramesAsText;
    211248}
    212249
     
    911948}
    912949
     950void TestRunner::dumpAsText(const CppArgumentList& arguments, CppVariant* result)
     951{
     952    m_dumpAsText = true;
     953    m_generatePixelResults = false;
     954
     955    // Optional paramater, describing whether it's allowed to dump pixel results in dumpAsText mode.
     956    if (arguments.size() > 0 && arguments[0].isBool())
     957        m_generatePixelResults = arguments[0].value.boolValue;
     958
     959    result->setNull();
     960}
     961
     962void TestRunner::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result)
     963{
     964    m_dumpChildFrameScrollPositions = true;
     965    result->setNull();
     966}
     967
     968void TestRunner::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result)
     969{
     970    m_dumpChildFramesAsText = true;
     971    result->setNull();
     972}
     973
    913974void TestRunner::workerThreadCount(CppVariant* result)
    914975{
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h

    r138814 r138980  
    6060    // WebTestRunner implementation.
    6161    virtual bool shouldDumpEditingCallbacks() const OVERRIDE;
     62    virtual bool shouldDumpAsText() const OVERRIDE;
     63    virtual void setShouldDumpAsText(bool) OVERRIDE;
     64    virtual bool shouldGeneratePixelResults() const OVERRIDE;
     65    virtual void setShouldGeneratePixelResults(bool) OVERRIDE;
     66    virtual bool shouldDumpChildFrameScrollPositions() const OVERRIDE;
     67    virtual bool shouldDumpChildFramesAsText() const OVERRIDE;
    6268
    6369protected:
     
    185191    void dumpEditingCallbacks(const CppArgumentList&, CppVariant*);
    186192
     193    // This function sets a flag that tells the test_shell to dump pages as
     194    // plain text, rather than as a text representation of the renderer's state.
     195    // It takes an optional argument, whether to dump pixels results or not.
     196    void dumpAsText(const CppArgumentList&, CppVariant*);
     197
     198    // This function sets a flag that tells the test_shell to print out the
     199    // scroll offsets of the child frames. It ignores all.
     200    void dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant*);
     201
     202    // This function sets a flag that tells the test_shell to recursively
     203    // dump all frames as plain text if the dumpAsText flag is set.
     204    // It takes no arguments, and ignores any that may be present.
     205    void dumpChildFramesAsText(const CppArgumentList&, CppVariant*);
     206
    187207    ///////////////////////////////////////////////////////////////////////////
    188208    // Methods interacting with the WebTestProxy
     
    231251    bool m_dumpEditingCallbacks;
    232252
     253    // If true, the test_shell will generate pixel results in dumpAsText mode
     254    bool m_generatePixelResults;
     255
     256    // If true, the test_shell will produce a plain text dump rather than a
     257    // text representation of the renderer.
     258    bool m_dumpAsText;
     259
     260    // If true and if dump_as_text_ is true, the test_shell will recursively
     261    // dump all frames as plain text.
     262    bool m_dumpChildFramesAsText;
     263
     264    // If true, the test_shell will print out the child frame scroll offsets as
     265    // well.
     266    bool m_dumpChildFrameScrollPositions;
     267
    233268    WebTestDelegate* m_delegate;
    234269    WebKit::WebView* m_webView;
Note: See TracChangeset for help on using the changeset viewer.