Changeset 139722 in webkit


Ignore:
Timestamp:
Jan 15, 2013 12:19:57 AM (11 years ago)
Author:
jochen@chromium.org
Message:

[chromium] move remaining methods that just set a boolean flag to TestRunner library
https://bugs.webkit.org/show_bug.cgi?id=106823

Reviewed by Darin Fisher.

  • DumpRenderTree/chromium/DRTTestRunner.cpp:

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

  • DumpRenderTree/chromium/DRTTestRunner.h:

(DRTTestRunner):

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

(WebTestRunner::WebTestRunner::shouldDumpBackForwardList):
(WebTestRunner::WebTestRunner::deferMainResourceDataLoad):
(WebTestRunner::WebTestRunner::shouldDumpSelectionRect):
(WebTestRunner::WebTestRunner::testRepaint):
(WebTestRunner::WebTestRunner::sweepHorizontally):
(WebTestRunner::WebTestRunner::isPrinting):
(WebTestRunner::WebTestRunner::shouldStayOnPageAfterHandlingBeforeUnload):

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

(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::reset):
(WebTestRunner::TestRunner::shouldDumpBackForwardList):
(WebTestRunner):
(WebTestRunner::TestRunner::deferMainResourceDataLoad):
(WebTestRunner::TestRunner::shouldDumpSelectionRect):
(WebTestRunner::TestRunner::testRepaint):
(WebTestRunner::TestRunner::sweepHorizontally):
(WebTestRunner::TestRunner::isPrinting):
(WebTestRunner::TestRunner::shouldStayOnPageAfterHandlingBeforeUnload):
(WebTestRunner::TestRunner::dumpBackForwardList):
(WebTestRunner::TestRunner::setDeferMainResourceDataLoad):
(WebTestRunner::TestRunner::dumpSelectionRect):
(WebTestRunner::TestRunner::repaintSweepHorizontally):
(WebTestRunner::TestRunner::setPrinting):
(WebTestRunner::TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload):

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

(TestRunner):

Location:
trunk/Tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r139715 r139722  
     12013-01-15  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] move remaining methods that just set a boolean flag to TestRunner library
     4        https://bugs.webkit.org/show_bug.cgi?id=106823
     5
     6        Reviewed by Darin Fisher.
     7
     8        * DumpRenderTree/chromium/DRTTestRunner.cpp:
     9        (DRTTestRunner::DRTTestRunner):
     10        (DRTTestRunner::reset):
     11        * DumpRenderTree/chromium/DRTTestRunner.h:
     12        (DRTTestRunner):
     13        * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
     14        (WebTestRunner::WebTestRunner::shouldDumpBackForwardList):
     15        (WebTestRunner::WebTestRunner::deferMainResourceDataLoad):
     16        (WebTestRunner::WebTestRunner::shouldDumpSelectionRect):
     17        (WebTestRunner::WebTestRunner::testRepaint):
     18        (WebTestRunner::WebTestRunner::sweepHorizontally):
     19        (WebTestRunner::WebTestRunner::isPrinting):
     20        (WebTestRunner::WebTestRunner::shouldStayOnPageAfterHandlingBeforeUnload):
     21        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
     22        (WebTestRunner::TestRunner::TestRunner):
     23        (WebTestRunner::TestRunner::reset):
     24        (WebTestRunner::TestRunner::shouldDumpBackForwardList):
     25        (WebTestRunner):
     26        (WebTestRunner::TestRunner::deferMainResourceDataLoad):
     27        (WebTestRunner::TestRunner::shouldDumpSelectionRect):
     28        (WebTestRunner::TestRunner::testRepaint):
     29        (WebTestRunner::TestRunner::sweepHorizontally):
     30        (WebTestRunner::TestRunner::isPrinting):
     31        (WebTestRunner::TestRunner::shouldStayOnPageAfterHandlingBeforeUnload):
     32        (WebTestRunner::TestRunner::dumpBackForwardList):
     33        (WebTestRunner::TestRunner::setDeferMainResourceDataLoad):
     34        (WebTestRunner::TestRunner::dumpSelectionRect):
     35        (WebTestRunner::TestRunner::repaintSweepHorizontally):
     36        (WebTestRunner::TestRunner::setPrinting):
     37        (WebTestRunner::TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload):
     38        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
     39        (TestRunner):
     40
    1412013-01-14  Dirk Pranke  <dpranke@chromium.org>
    242
  • trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp

    r139627 r139722  
    8888    : m_shell(shell)
    8989    , m_closeRemainingWindows(false)
    90     , m_deferMainResourceDataLoad(false)
    9190    , m_showDebugLayerTree(false)
    9291    , m_workQueue(this)
    93     , m_shouldStayOnPageAfterHandlingBeforeUnload(false)
    9492{
    9593
     
    115113    bindMethod("display", &DRTTestRunner::display);
    116114    bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion);
    117     bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList);
    118     bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect);
    119115#if ENABLE(NOTIFICATIONS)
    120116    bindMethod("grantWebNotificationPermission", &DRTTestRunner::grantWebNotificationPermission);
     
    130126    bindMethod("queueNonLoadingScript", &DRTTestRunner::queueNonLoadingScript);
    131127    bindMethod("queueReload", &DRTTestRunner::queueReload);
    132     bindMethod("repaintSweepHorizontally", &DRTTestRunner::repaintSweepHorizontally);
    133128    bindMethod("setAlwaysAcceptCookies", &DRTTestRunner::setAlwaysAcceptCookies);
    134129    bindMethod("setCloseRemainingWindowsWhenComplete", &DRTTestRunner::setCloseRemainingWindowsWhenComplete);
    135130    bindMethod("setCustomPolicyDelegate", &DRTTestRunner::setCustomPolicyDelegate);
    136131    bindMethod("setDatabaseQuota", &DRTTestRunner::setDatabaseQuota);
    137     bindMethod("setDeferMainResourceDataLoad", &DRTTestRunner::setDeferMainResourceDataLoad);
    138132    bindMethod("setGeolocationPermission", &DRTTestRunner::setGeolocationPermission);
    139133    bindMethod("setMockDeviceOrientation", &DRTTestRunner::setMockDeviceOrientation);
     
    145139#endif
    146140    bindMethod("setPOSIXLocale", &DRTTestRunner::setPOSIXLocale);
    147     bindMethod("setPrinting", &DRTTestRunner::setPrinting);
    148141    bindMethod("setBackingScaleFactor", &DRTTestRunner::setBackingScaleFactor);
    149142    bindMethod("setWillSendRequestClearHeader", &DRTTestRunner::setWillSendRequestClearHeader);
     
    154147    bindMethod("simulateLegacyWebNotificationClick", &DRTTestRunner::simulateLegacyWebNotificationClick);
    155148#endif
    156     bindMethod("testRepaint", &DRTTestRunner::testRepaint);
    157149    bindMethod("waitForPolicyDelegate", &DRTTestRunner::waitForPolicyDelegate);
    158150    bindMethod("waitUntilDone", &DRTTestRunner::waitUntilDone);
    159151    bindMethod("windowCount", &DRTTestRunner::windowCount);
    160152
    161     bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload);
    162153
    163154    // Shared properties.
     
    218209    }
    219210    m_queue.append(work);
    220 }
    221 
    222 void DRTTestRunner::dumpBackForwardList(const CppArgumentList&, CppVariant* result)
    223 {
    224     m_dumpBackForwardList = true;
    225     result->setNull();
    226211}
    227212
     
    410395    if (m_shell)
    411396        m_shell->webViewHost()->setDeviceScaleFactor(1);
    412     m_dumpBackForwardList = false;
    413     m_dumpSelectionRect = false;
    414397    m_waitUntilDone = false;
    415     m_testRepaint = false;
    416     m_sweepHorizontally = false;
    417     m_deferMainResourceDataLoad = true;
    418398    m_webHistoryItemCount.set(0);
    419399    m_titleTextDirection.set("ltr");
    420400    m_interceptPostMessage.set(false);
    421     m_isPrinting = false;
    422401
    423402    webkit_support::SetAcceptAllCookies(false);
     
    434413    m_workQueue.reset();
    435414    m_taskList.revokeAll();
    436     m_shouldStayOnPageAfterHandlingBeforeUnload = false;
    437415}
    438416
     
    591569#endif
    592570
    593 void DRTTestRunner::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result)
    594 {
    595     if (arguments.size() == 1)
    596         m_deferMainResourceDataLoad = cppVariantToBool(arguments[0]);
    597 }
    598 
    599 void DRTTestRunner::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result)
    600 {
    601     m_dumpSelectionRect = true;
    602     result->setNull();
    603 }
    604 
    605571void DRTTestRunner::display(const CppArgumentList& arguments, CppVariant* result)
    606572{
     
    622588}
    623589
    624 void DRTTestRunner::testRepaint(const CppArgumentList&, CppVariant* result)
    625 {
    626     m_testRepaint = true;
    627     result->setNull();
    628 }
    629 
    630 void DRTTestRunner::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result)
    631 {
    632     m_sweepHorizontally = true;
    633     result->setNull();
    634 }
    635 
    636590void DRTTestRunner::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result)
    637591{
     
    652606    if (arguments.size() == 1 && arguments[0].isString())
    653607        setlocale(LC_ALL, arguments[0].toString().c_str());
    654 }
    655 
    656 void DRTTestRunner::setPrinting(const CppArgumentList& arguments, CppVariant* result)
    657 {
    658     setIsPrinting(true);
    659     result->setNull();
    660608}
    661609
     
    775723#endif
    776724
    777 void DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result)
    778 {
    779     if (arguments.size() == 1 && arguments[0].isBool())
    780         m_shouldStayOnPageAfterHandlingBeforeUnload = arguments[0].toBoolean();
    781 
    782     result->setNull();
    783 }
    784 
    785725class InvokeCallbackTask : public WebMethodTask<DRTTestRunner> {
    786726public:
  • trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h

    r139627 r139722  
    7676    virtual ~DRTTestRunner();
    7777
    78     // This function sets a flag that tells the test_shell to print out a text
    79     // representation of the back/forward list. It ignores all arguments.
    80     void dumpBackForwardList(const CppArgumentList&, CppVariant*);
    81 
    8278    // Functions for dealing with windows. By default we block all new windows.
    8379    void windowCount(const CppArgumentList&, CppVariant*);
     
    126122    void pathToLocalResource(const CppArgumentList&, CppVariant*);
    127123
    128     void dumpSelectionRect(const CppArgumentList&, CppVariant*);
    129 
    130124#if ENABLE(NOTIFICATIONS)
    131125    // Grants permission for desktop notifications to an origin
     
    135129#endif
    136130
    137     void setDeferMainResourceDataLoad(const CppArgumentList&, CppVariant*);
    138 
    139131    void display(const CppArgumentList&, CppVariant*);
    140132    void displayInvalidatedRegion(const CppArgumentList&, CppVariant*);
    141     void testRepaint(const CppArgumentList&, CppVariant*);
    142     void repaintSweepHorizontally(const CppArgumentList&, CppVariant*);
    143133
    144134    // Clears all databases.
     
    151141    void setPOSIXLocale(const CppArgumentList&, CppVariant*);
    152142
    153     // Causes layout to happen as if targetted to printed pages.
    154     void setPrinting(const CppArgumentList&, CppVariant*);
    155 
    156143    // Gets the number of geolocation permissions requests pending.
    157144    void numberOfPendingGeolocationPermissionRequests(const CppArgumentList&, CppVariant*);
     
    175162    void wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant*);
    176163#endif
    177 
    178     void setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList&, CppVariant*);
    179164
    180165#if ENABLE(POINTER_LOCK)
     
    193178    void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
    194179
    195     bool shouldDumpSelectionRect() { return m_dumpSelectionRect; }
    196     bool shouldDumpBackForwardList() { return m_dumpBackForwardList; }
    197     bool deferMainResourceDataLoad() { return m_deferMainResourceDataLoad; }
    198180    void setShowDebugLayerTree(bool value) { m_showDebugLayerTree = value; }
    199181    void setTitleTextDirection(WebKit::WebTextDirection dir)
     
    207189    }
    208190
    209     void setIsPrinting(bool value) { m_isPrinting = value; }
    210     bool isPrinting() { return m_isPrinting; }
    211 
    212     bool testRepaint() const { return m_testRepaint; }
    213     bool sweepHorizontally() const { return m_sweepHorizontally; }
    214 
    215191    // Called by the webview delegate when the toplevel frame load is done.
    216192    void locationChangeDone();
     
    234210
    235211    WebTaskList* taskList() { return &m_taskList; }
    236 
    237     bool shouldStayOnPageAfterHandlingBeforeUnload() const { return m_shouldStayOnPageAfterHandlingBeforeUnload; }
    238212
    239213private:
     
    284258    TestShell* m_shell;
    285259
    286     // If true, the test_shell will draw the bounds of the current selection rect
    287     // taking possible transforms of the selection rect into account.
    288     bool m_dumpSelectionRect;
    289 
    290     // If true, the test_shell will produce a dump of the back forward list as
    291     // well.
    292     bool m_dumpBackForwardList;
    293 
    294260    // When reset is called, go through and close all but the main test shell
    295261    // window. By default, set to true but toggled to false using
     
    297263    bool m_closeRemainingWindows;
    298264
    299     // If true, pixel dump will be produced as a series of 1px-tall, view-wide
    300     // individual paints over the height of the view.
    301     bool m_testRepaint;
    302     // If true and test_repaint_ is true as well, pixel dump will be produced as
    303     // a series of 1px-wide, view-tall paints across the width of the view.
    304     bool m_sweepHorizontally;
    305 
    306265    // If true, don't dump output until notifyDone is called.
    307266    bool m_waitUntilDone;
    308267
    309     // If false, all new requests will not defer the main resource data load.
    310     bool m_deferMainResourceDataLoad;
    311 
    312268    // If true, we will show extended information in the graphics layer tree.
    313269    bool m_showDebugLayerTree;
    314270
    315     // If true, layout is to target printed pages.
    316     bool m_isPrinting;
    317 
    318271    WorkQueue m_workQueue;
    319272
     
    326279    // Bound variable to set whether postMessages should be intercepted or not
    327280    CppVariant m_interceptPostMessage;
    328 
    329     bool m_shouldStayOnPageAfterHandlingBeforeUnload;
    330281};
    331282
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h

    r139627 r139722  
    6666    virtual bool shouldDumpStatusCallbacks() const { return false; }
    6767    virtual bool shouldDumpProgressFinishedCallback() const { return false; }
     68    virtual bool shouldDumpBackForwardList() const { return false; }
     69    virtual bool deferMainResourceDataLoad() const { return false; }
     70    virtual bool shouldDumpSelectionRect() const { return false; }
     71    virtual bool testRepaint() const { return false; }
     72    virtual bool sweepHorizontally() const { return false; }
     73    virtual bool isPrinting() const { return false; }
     74    virtual bool shouldStayOnPageAfterHandlingBeforeUnload() const { return false; }
    6875};
    6976
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp

    r139627 r139722  
    163163    bindMethod("dumpStatusCallbacks", &TestRunner::dumpWindowStatusChanges);
    164164    bindMethod("dumpProgressFinishedCallback", &TestRunner::dumpProgressFinishedCallback);
     165    bindMethod("dumpBackForwardList", &TestRunner::dumpBackForwardList);
     166    bindMethod("setDeferMainResourceDataLoad", &TestRunner::setDeferMainResourceDataLoad);
     167    bindMethod("dumpSelectionRect", &TestRunner::dumpSelectionRect);
     168    bindMethod("testRepaint", &TestRunner::testRepaint);
     169    bindMethod("repaintSweepHorizontally", &TestRunner::repaintSweepHorizontally);
     170    bindMethod("setPrinting", &TestRunner::setPrinting);
     171    bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload);
    165172
    166173    // The following methods interact with the WebTestProxy.
     
    255262    m_dumpWindowStatusChanges = false;
    256263    m_dumpProgressFinishedCallback = false;
     264    m_dumpBackForwardList = false;
     265    m_deferMainResourceDataLoad = true;
     266    m_dumpSelectionRect = false;
     267    m_testRepaint = false;
     268    m_sweepHorizontally = false;
     269    m_isPrinting = false;
     270    m_shouldStayOnPageAfterHandlingBeforeUnload = false;
    257271
    258272    m_globalFlag.set(false);
     
    379393}
    380394
     395bool TestRunner::shouldDumpBackForwardList() const
     396{
     397    return m_dumpBackForwardList;
     398}
     399
     400bool TestRunner::deferMainResourceDataLoad() const
     401{
     402    return m_deferMainResourceDataLoad;
     403}
     404
     405bool TestRunner::shouldDumpSelectionRect() const
     406{
     407    return m_dumpSelectionRect;
     408}
     409
     410bool TestRunner::testRepaint() const
     411{
     412    return m_testRepaint;
     413}
     414
     415bool TestRunner::sweepHorizontally() const
     416{
     417    return m_sweepHorizontally;
     418}
     419
     420bool TestRunner::isPrinting() const
     421{
     422    return m_isPrinting;
     423}
     424
     425bool TestRunner::shouldStayOnPageAfterHandlingBeforeUnload() const
     426{
     427    return m_shouldStayOnPageAfterHandlingBeforeUnload;
     428}
     429
    381430void TestRunner::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result)
    382431{
     
    438487{
    439488    m_dumpProgressFinishedCallback = true;
     489    result->setNull();
     490}
     491
     492void TestRunner::dumpBackForwardList(const CppArgumentList&, CppVariant* result)
     493{
     494    m_dumpBackForwardList = true;
     495    result->setNull();
     496}
     497
     498void TestRunner::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result)
     499{
     500    if (arguments.size() == 1)
     501        m_deferMainResourceDataLoad = cppVariantToBool(arguments[0]);
     502}
     503
     504void TestRunner::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result)
     505{
     506    m_dumpSelectionRect = true;
     507    result->setNull();
     508}
     509
     510void TestRunner::testRepaint(const CppArgumentList&, CppVariant* result)
     511{
     512    m_testRepaint = true;
     513    result->setNull();
     514}
     515
     516void TestRunner::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result)
     517{
     518    m_sweepHorizontally = true;
     519    result->setNull();
     520}
     521
     522void TestRunner::setPrinting(const CppArgumentList& arguments, CppVariant* result)
     523{
     524    m_isPrinting = true;
     525    result->setNull();
     526}
     527
     528void TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result)
     529{
     530    if (arguments.size() == 1 && arguments[0].isBool())
     531        m_shouldStayOnPageAfterHandlingBeforeUnload = arguments[0].toBoolean();
     532
    440533    result->setNull();
    441534}
  • trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h

    r139627 r139722  
    8484    virtual bool shouldDumpStatusCallbacks() const OVERRIDE;
    8585    virtual bool shouldDumpProgressFinishedCallback() const OVERRIDE;
     86    virtual bool shouldDumpBackForwardList() const OVERRIDE;
     87    virtual bool deferMainResourceDataLoad() const OVERRIDE;
     88    virtual bool shouldDumpSelectionRect() const OVERRIDE;
     89    virtual bool testRepaint() const OVERRIDE;
     90    virtual bool sweepHorizontally() const OVERRIDE;
     91    virtual bool isPrinting() const OVERRIDE;
     92    virtual bool shouldStayOnPageAfterHandlingBeforeUnload() const OVERRIDE;
    8693
    8794protected:
     
    291298    void dumpProgressFinishedCallback(const CppArgumentList&, CppVariant*);
    292299
     300    // This function sets a flag that tells the test_shell to print out a text
     301    // representation of the back/forward list. It ignores all arguments.
     302    void dumpBackForwardList(const CppArgumentList&, CppVariant*);
     303
     304    void setDeferMainResourceDataLoad(const CppArgumentList&, CppVariant*);
     305    void dumpSelectionRect(const CppArgumentList&, CppVariant*);
     306    void testRepaint(const CppArgumentList&, CppVariant*);
     307    void repaintSweepHorizontally(const CppArgumentList&, CppVariant*);
     308
     309    // Causes layout to happen as if targetted to printed pages.
     310    void setPrinting(const CppArgumentList&, CppVariant*);
     311
     312    void setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList&, CppVariant*);
     313
    293314    ///////////////////////////////////////////////////////////////////////////
    294315    // Methods interacting with the WebTestProxy
     
    410431    bool m_dumpProgressFinishedCallback;
    411432
     433    // If true, the test_shell will produce a dump of the back forward list as
     434    // well.
     435    bool m_dumpBackForwardList;
     436
     437    // If false, all new requests will not defer the main resource data load.
     438    bool m_deferMainResourceDataLoad;
     439
     440    // If true, the test_shell will draw the bounds of the current selection rect
     441    // taking possible transforms of the selection rect into account.
     442    bool m_dumpSelectionRect;
     443
     444    // If true, pixel dump will be produced as a series of 1px-tall, view-wide
     445    // individual paints over the height of the view.
     446    bool m_testRepaint;
     447
     448    // If true and test_repaint_ is true as well, pixel dump will be produced as
     449    // a series of 1px-wide, view-tall paints across the width of the view.
     450    bool m_sweepHorizontally;
     451
     452    // If true, layout is to target printed pages.
     453    bool m_isPrinting;
     454
     455    bool m_shouldStayOnPageAfterHandlingBeforeUnload;
     456
    412457    // WAV audio data is stored here.
    413458    WebKit::WebArrayBufferView m_audioData;
Note: See TracChangeset for help on using the changeset viewer.