Title: [138980] trunk/Tools
Revision
138980
Author
[email protected]
Date
2013-01-07 13:21:28 -0800 (Mon, 07 Jan 2013)

Log 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):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (138979 => 138980)


--- trunk/Tools/ChangeLog	2013-01-07 20:58:46 UTC (rev 138979)
+++ trunk/Tools/ChangeLog	2013-01-07 21:21:28 UTC (rev 138980)
@@ -1,3 +1,40 @@
+2013-01-07  Jochen Eisinger  <[email protected]>
+
+        [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):
+
 2013-01-07  Ryosuke Niwa  <[email protected]>
 
         Build fix attempt after r138810.

Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp (138979 => 138980)


--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp	2013-01-07 20:58:46 UTC (rev 138979)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp	2013-01-07 21:21:28 UTC (rev 138980)
@@ -117,10 +117,7 @@
     bindMethod("disableAutoResizeMode", &DRTTestRunner::disableAutoResizeMode);
     bindMethod("display", &DRTTestRunner::display);
     bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion);
-    bindMethod("dumpAsText", &DRTTestRunner::dumpAsText);
     bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList);
-    bindMethod("dumpChildFramesAsText", &DRTTestRunner::dumpChildFramesAsText);
-    bindMethod("dumpChildFrameScrollPositions", &DRTTestRunner::dumpChildFrameScrollPositions);
     bindMethod("dumpFrameLoadCallbacks", &DRTTestRunner::dumpFrameLoadCallbacks);
     bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback);
     bindMethod("dumpUserGestureInFrameLoadCallbacks", &DRTTestRunner::dumpUserGestureInFrameLoadCallbacks);
@@ -249,18 +246,6 @@
     m_queue.append(work);
 }
 
-void DRTTestRunner::dumpAsText(const CppArgumentList& arguments, CppVariant* result)
-{
-    m_dumpAsText = true;
-    m_generatePixelResults = false;
-
-    // Optional paramater, describing whether it's allowed to dump pixel results in dumpAsText mode.
-    if (arguments.size() > 0 && arguments[0].isBool())
-        m_generatePixelResults = arguments[0].value.boolValue;
-
-    result->setNull();
-}
-
 void DRTTestRunner::dumpBackForwardList(const CppArgumentList&, CppVariant* result)
 {
     m_dumpBackForwardList = true;
@@ -303,18 +288,6 @@
     result->setNull();
 }
 
-void DRTTestRunner::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result)
-{
-    m_dumpChildFrameScrollPositions = true;
-    result->setNull();
-}
-
-void DRTTestRunner::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result)
-{
-    m_dumpChildFramesAsText = true;
-    result->setNull();
-}
-
 void DRTTestRunner::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result)
 {
     m_dumpWindowStatusChanges = true;
@@ -523,7 +496,6 @@
     TestRunner::reset();
     if (m_shell)
         m_shell->webViewHost()->setDeviceScaleFactor(1);
-    m_dumpAsText = false;
     m_dumpAsAudio = false;
     m_dumpCreateView = false;
     m_dumpFrameLoadCallbacks = false;
@@ -533,13 +505,10 @@
     m_dumpResourceRequestCallbacks = false;
     m_dumpResourceResponseMIMETypes = false;
     m_dumpBackForwardList = false;
-    m_dumpChildFrameScrollPositions = false;
-    m_dumpChildFramesAsText = false;
     m_dumpWindowStatusChanges = false;
     m_dumpSelectionRect = false;
     m_dumpTitleChanges = false;
     m_dumpPermissionClientCallbacks = false;
-    m_generatePixelResults = true;
     m_waitUntilDone = false;
     m_canOpenWindows = false;
     m_testRepaint = false;

Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h (138979 => 138980)


--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2013-01-07 20:58:46 UTC (rev 138979)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2013-01-07 21:21:28 UTC (rev 138980)
@@ -75,11 +75,6 @@
 
     virtual ~DRTTestRunner();
 
-    // This function sets a flag that tells the test_shell to dump pages as
-    // plain text, rather than as a text representation of the renderer's state.
-    // It takes an optional argument, whether to dump pixels results or not.
-    void dumpAsText(const CppArgumentList&, CppVariant*);
-
     // This function sets a flag that tells the test_shell to print a line of
     // descriptive text for each frame load callback. It takes no arguments, and
     // ignores any that may be present.
@@ -99,15 +94,6 @@
     // representation of the back/forward list. It ignores all arguments.
     void dumpBackForwardList(const CppArgumentList&, CppVariant*);
 
-    // This function sets a flag that tells the test_shell to print out the
-    // scroll offsets of the child frames. It ignores all.
-    void dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant*);
-
-    // This function sets a flag that tells the test_shell to recursively
-    // dump all frames as plain text if the dumpAsText flag is set.
-    // It takes no arguments, and ignores any that may be present.
-    void dumpChildFramesAsText(const CppArgumentList&, CppVariant*);
-    
     // This function sets a flag that tells the test_shell to dump a descriptive
     // line for each resource load callback. It takes no arguments, and ignores
     // any that may be present.
@@ -282,8 +268,6 @@
 
     bool shouldDumpAsAudio() const { return m_dumpAsAudio; } 
     void setShouldDumpAsAudio(bool dumpAsAudio) { m_dumpAsAudio = dumpAsAudio; } 
-    bool shouldDumpAsText() { return m_dumpAsText; }
-    void setShouldDumpAsText(bool value) { m_dumpAsText = value; }
     bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
     void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
     bool shouldDumpProgressFinishedCallback() { return m_dumpProgressFinishedCallback; }
@@ -300,10 +284,6 @@
     bool shouldDumpBackForwardList() { return m_dumpBackForwardList; }
     bool shouldDumpTitleChanges() { return m_dumpTitleChanges; }
     bool shouldDumpPermissionClientCallbacks() { return m_dumpPermissionClientCallbacks; }
-    bool shouldDumpChildFrameScrollPositions() { return m_dumpChildFrameScrollPositions; }
-    bool shouldDumpChildFramesAsText() { return m_dumpChildFramesAsText; }
-    bool shouldGeneratePixelResults() { return m_generatePixelResults; }
-    void setShouldGeneratePixelResults(bool value) { m_generatePixelResults = value; }
     bool shouldDumpCreateView() { return m_dumpCreateView; }
     bool canOpenWindows() { return m_canOpenWindows; }
     bool stopProvisionalFrameLoads() { return m_stopProvisionalFrameLoads; }
@@ -396,10 +376,6 @@
     // Non-owning pointer. The DRTTestRunner is owned by the host.
     TestShell* m_shell;
 
-    // If true, the test_shell will produce a plain text dump rather than a
-    // text representation of the renderer.
-    bool m_dumpAsText;
-
     // If true, the test_shell will output a base64 encoded WAVE file.
     bool m_dumpAsAudio;
 
@@ -435,14 +411,6 @@
     // well.
     bool m_dumpBackForwardList;
 
-    // If true, the test_shell will print out the child frame scroll offsets as
-    // well.
-    bool m_dumpChildFrameScrollPositions;
-
-    // If true and if dump_as_text_ is true, the test_shell will recursively
-    // dump all frames as plain text.
-    bool m_dumpChildFramesAsText;
-
     // If true, the test_shell will dump all changes to window.status.
     bool m_dumpWindowStatusChanges;
 
@@ -453,9 +421,6 @@
     // callback is invoked. Currently only implemented for allowImage.
     bool m_dumpPermissionClientCallbacks;
 
-    // If true, the test_shell will generate pixel results in dumpAsText mode
-    bool m_generatePixelResults;
-
     // If true, output a descriptive line each time WebViewClient::createView
     // is invoked.
     bool m_dumpCreateView;

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h (138979 => 138980)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h	2013-01-07 20:58:46 UTC (rev 138979)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h	2013-01-07 21:21:28 UTC (rev 138980)
@@ -38,6 +38,12 @@
 class WebTestRunner {
 public:
     virtual bool shouldDumpEditingCallbacks() const { return false; }
+    virtual bool shouldDumpAsText() const { return false; }
+    virtual void setShouldDumpAsText(bool) { }
+    virtual bool shouldGeneratePixelResults() const { return false; }
+    virtual void setShouldGeneratePixelResults(bool) { }
+    virtual bool shouldDumpChildFrameScrollPositions() const { return false; }
+    virtual bool shouldDumpChildFramesAsText() const { return false; }
 };
 
 }

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (138979 => 138980)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2013-01-07 20:58:46 UTC (rev 138979)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2013-01-07 21:21:28 UTC (rev 138980)
@@ -133,6 +133,9 @@
 
     // The following modify the state of the TestRunner.
     bindMethod("dumpEditingCallbacks", &TestRunner::dumpEditingCallbacks);
+    bindMethod("dumpAsText", &TestRunner::dumpAsText);
+    bindMethod("dumpChildFramesAsText", &TestRunner::dumpChildFramesAsText);
+    bindMethod("dumpChildFrameScrollPositions", &TestRunner::dumpChildFrameScrollPositions);
 
     // The following methods interact with the WebTestProxy.
     bindMethod("sendWebIntentResponse", &TestRunner::sendWebIntentResponse);
@@ -198,6 +201,10 @@
 #endif
 
     m_dumpEditingCallbacks = false;
+    m_dumpAsText = false;
+    m_generatePixelResults = true;
+    m_dumpChildFrameScrollPositions = false;
+    m_dumpChildFramesAsText = false;
 
     m_globalFlag.set(false);
     m_platformName.set("chromium");
@@ -210,6 +217,36 @@
     return m_dumpEditingCallbacks;
 }
 
+bool TestRunner::shouldDumpAsText() const
+{
+    return m_dumpAsText;
+}
+
+void TestRunner::setShouldDumpAsText(bool value)
+{
+    m_dumpAsText = value;
+}
+
+bool TestRunner::shouldGeneratePixelResults() const
+{
+    return m_generatePixelResults;
+}
+
+void TestRunner::setShouldGeneratePixelResults(bool value)
+{
+    m_generatePixelResults = value;
+}
+
+bool TestRunner::shouldDumpChildFrameScrollPositions() const
+{
+    return m_dumpChildFrameScrollPositions;
+}
+
+bool TestRunner::shouldDumpChildFramesAsText() const
+{
+    return m_dumpChildFramesAsText;
+}
+
 void TestRunner::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result)
 {
     if (arguments.size() > 0 && arguments[0].isBool())
@@ -910,6 +947,30 @@
     result->setNull();
 }
 
+void TestRunner::dumpAsText(const CppArgumentList& arguments, CppVariant* result)
+{
+    m_dumpAsText = true;
+    m_generatePixelResults = false;
+
+    // Optional paramater, describing whether it's allowed to dump pixel results in dumpAsText mode.
+    if (arguments.size() > 0 && arguments[0].isBool())
+        m_generatePixelResults = arguments[0].value.boolValue;
+
+    result->setNull();
+}
+
+void TestRunner::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpChildFrameScrollPositions = true;
+    result->setNull();
+}
+
+void TestRunner::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpChildFramesAsText = true;
+    result->setNull();
+}
+
 void TestRunner::workerThreadCount(CppVariant* result)
 {
     result->set(static_cast<int>(WebWorkerInfo::dedicatedWorkerCount()));

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (138979 => 138980)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2013-01-07 20:58:46 UTC (rev 138979)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2013-01-07 21:21:28 UTC (rev 138980)
@@ -59,6 +59,12 @@
 
     // WebTestRunner implementation.
     virtual bool shouldDumpEditingCallbacks() const OVERRIDE;
+    virtual bool shouldDumpAsText() const OVERRIDE;
+    virtual void setShouldDumpAsText(bool) OVERRIDE;
+    virtual bool shouldGeneratePixelResults() const OVERRIDE;
+    virtual void setShouldGeneratePixelResults(bool) OVERRIDE;
+    virtual bool shouldDumpChildFrameScrollPositions() const OVERRIDE;
+    virtual bool shouldDumpChildFramesAsText() const OVERRIDE;
 
 protected:
     // FIXME: make these private once the move from DRTTestRunner to TestRunner
@@ -184,6 +190,20 @@
     // ignores any that may be present.
     void dumpEditingCallbacks(const CppArgumentList&, CppVariant*);
 
+    // This function sets a flag that tells the test_shell to dump pages as
+    // plain text, rather than as a text representation of the renderer's state.
+    // It takes an optional argument, whether to dump pixels results or not.
+    void dumpAsText(const CppArgumentList&, CppVariant*);
+
+    // This function sets a flag that tells the test_shell to print out the
+    // scroll offsets of the child frames. It ignores all.
+    void dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant*);
+
+    // This function sets a flag that tells the test_shell to recursively
+    // dump all frames as plain text if the dumpAsText flag is set.
+    // It takes no arguments, and ignores any that may be present.
+    void dumpChildFramesAsText(const CppArgumentList&, CppVariant*);
+
     ///////////////////////////////////////////////////////////////////////////
     // Methods interacting with the WebTestProxy
 
@@ -230,6 +250,21 @@
     // command.
     bool m_dumpEditingCallbacks;
 
+    // If true, the test_shell will generate pixel results in dumpAsText mode
+    bool m_generatePixelResults;
+
+    // If true, the test_shell will produce a plain text dump rather than a
+    // text representation of the renderer.
+    bool m_dumpAsText;
+
+    // If true and if dump_as_text_ is true, the test_shell will recursively
+    // dump all frames as plain text.
+    bool m_dumpChildFramesAsText;
+
+    // If true, the test_shell will print out the child frame scroll offsets as
+    // well.
+    bool m_dumpChildFrameScrollPositions;
+
     WebTestDelegate* m_delegate;
     WebKit::WebView* m_webView;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to