Title: [142370] trunk/Tools
Revision
142370
Author
[email protected]
Date
2013-02-09 10:55:36 -0800 (Sat, 09 Feb 2013)

Log Message

[chromium] move methods that change initial testRunner state to TestRunner library
https://bugs.webkit.org/show_bug.cgi?id=109043

Reviewed by Adam Barth.

* DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h:
(WebKit):
* DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp:
(WebTestRunner::TestInterfaces::configureForTestWithURL):
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h:
(WebKit):
(TestInterfaces):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::showDevTools):
(WebTestRunner):
(WebTestRunner::TestRunner::showWebInspector):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(TestRunner):
* DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp:
(WebTestRunner::WebTestInterfaces::configureForTestWithURL):
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::runFileTest):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (142369 => 142370)


--- trunk/Tools/ChangeLog	2013-02-09 18:41:26 UTC (rev 142369)
+++ trunk/Tools/ChangeLog	2013-02-09 18:55:36 UTC (rev 142370)
@@ -1,3 +1,31 @@
+2013-02-09  Jochen Eisinger  <[email protected]>
+
+        [chromium] move methods that change initial testRunner state to TestRunner library
+        https://bugs.webkit.org/show_bug.cgi?id=109043
+
+        Reviewed by Adam Barth.
+
+        * DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h:
+        (WebKit):
+        * DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp:
+        (WebTestRunner::TestInterfaces::configureForTestWithURL):
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h:
+        (WebKit):
+        (TestInterfaces):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+        (WebTestRunner::TestRunner::showDevTools):
+        (WebTestRunner):
+        (WebTestRunner::TestRunner::showWebInspector):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
+        (TestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp:
+        (WebTestRunner::WebTestInterfaces::configureForTestWithURL):
+        * DumpRenderTree/chromium/TestShell.cpp:
+        (TestShell::runFileTest):
+
 2013-02-09  Nico Weber  <[email protected]>
 
         Add myself as a reviewer. (Yay!!!!!)

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h (142369 => 142370)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h	2013-02-09 18:41:26 UTC (rev 142369)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h	2013-02-09 18:55:36 UTC (rev 142370)
@@ -36,6 +36,7 @@
 
 namespace WebKit {
 class WebFrame;
+class WebURL;
 class WebView;
 }
 
@@ -55,8 +56,8 @@
     void bindTo(WebKit::WebFrame*);
     void resetAll();
     void setTestIsRunning(bool);
+    void configureForTestWithURL(const WebKit::WebURL&, bool generatePixels);
 
-    WebKit::WebView* webView() const;
     WebTestRunner* testRunner();
 
 #if WEBTESTRUNNER_IMPLEMENTATION

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


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h	2013-02-09 18:41:26 UTC (rev 142369)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h	2013-02-09 18:55:36 UTC (rev 142370)
@@ -41,14 +41,11 @@
 class WebTestRunner {
 public:
     virtual bool shouldDumpAsText() const = 0;
-    virtual void setShouldDumpAsText(bool) = 0;
     virtual bool shouldGeneratePixelResults() const = 0;
-    virtual void setShouldGeneratePixelResults(bool) = 0;
     virtual bool shouldDumpChildFrameScrollPositions() const = 0;
     virtual bool shouldDumpChildFramesAsText() const = 0;
     virtual bool shouldDumpAsAudio() const = 0;
     virtual const WebKit::WebArrayBufferView* audioData() const = 0;
-    virtual void setShouldDumpFrameLoadCallbacks(bool) = 0;
     virtual WebKit::WebPermissionClient* webPermissions() const = 0;
     virtual bool shouldDumpBackForwardList() const = 0;
     virtual bool shouldDumpSelectionRect() const = 0;

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp (142369 => 142370)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp	2013-02-09 18:41:26 UTC (rev 142369)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp	2013-02-09 18:55:36 UTC (rev 142370)
@@ -37,10 +37,11 @@
 #include "TestRunner.h"
 #include "TextInputController.h"
 #include <public/WebString.h>
+#include <public/WebURL.h>
+#include <string>
 
-using WebKit::WebFrame;
-using WebKit::WebString;
-using WebKit::WebView;
+using namespace WebKit;
+using namespace std;
 
 namespace WebTestRunner {
 
@@ -112,6 +113,20 @@
     m_testRunner->setTestIsRunning(running);
 }
 
+void TestInterfaces::configureForTestWithURL(const WebURL& testURL, bool generatePixels)
+{
+    string spec = GURL(testURL).spec();
+    m_testRunner->setShouldGeneratePixelResults(generatePixels);
+    if (spec.find("loading/") != string::npos)
+        m_testRunner->setShouldDumpFrameLoadCallbacks(true);
+    if (spec.find("/dumpAsText/") != string::npos) {
+        m_testRunner->setShouldDumpAsText(true);
+        m_testRunner->setShouldGeneratePixelResults(false);
+    }
+    if (spec.find("/inspector/") != string::npos)
+        m_testRunner->showDevTools();
+}
+
 AccessibilityController* TestInterfaces::accessibilityController()
 {
     return m_accessibilityController.get();

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h (142369 => 142370)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h	2013-02-09 18:41:26 UTC (rev 142369)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h	2013-02-09 18:55:36 UTC (rev 142370)
@@ -35,6 +35,7 @@
 
 namespace WebKit {
 class WebFrame;
+class WebURL;
 class WebView;
 }
 
@@ -57,6 +58,7 @@
     void bindTo(WebKit::WebFrame*);
     void resetAll();
     void setTestIsRunning(bool);
+    void configureForTestWithURL(const WebKit::WebURL&, bool generatePixels);
 
     AccessibilityController* accessibilityController();
     EventSender* eventSender();

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (142369 => 142370)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2013-02-09 18:41:26 UTC (rev 142369)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2013-02-09 18:55:36 UTC (rev 142370)
@@ -658,6 +658,11 @@
     return m_selectTrailingWhitespaceEnabled;
 }
 
+void TestRunner::showDevTools()
+{
+    m_delegate->showDevTools();
+}
+
 void TestRunner::waitUntilDone(const CppArgumentList&, CppVariant* result)
 {
     if (!m_delegate->isBeingDebugged())
@@ -1704,7 +1709,7 @@
 
 void TestRunner::showWebInspector(const CppArgumentList&, CppVariant* result)
 {
-    m_delegate->showDevTools();
+    showDevTools();
     result->setNull();
 }
 

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (142369 => 142370)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2013-02-09 18:41:26 UTC (rev 142369)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2013-02-09 18:55:36 UTC (rev 142370)
@@ -73,14 +73,11 @@
 
     // WebTestRunner implementation.
     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;
     virtual bool shouldDumpAsAudio() const OVERRIDE;
     virtual const WebKit::WebArrayBufferView* audioData() const OVERRIDE;
-    virtual void setShouldDumpFrameLoadCallbacks(bool) OVERRIDE;
     virtual WebKit::WebPermissionClient* webPermissions() const OVERRIDE;
     virtual bool shouldDumpBackForwardList() const OVERRIDE;
     virtual bool shouldDumpSelectionRect() const OVERRIDE;
@@ -89,6 +86,10 @@
     virtual bool isPrinting() const OVERRIDE;
 
     // Methods used by WebTestProxyBase.
+    void showDevTools();
+    void setShouldDumpAsText(bool);
+    void setShouldGeneratePixelResults(bool);
+    void setShouldDumpFrameLoadCallbacks(bool);
     bool shouldDumpEditingCallbacks() const;
     bool shouldDumpFrameLoadCallbacks() const;
     bool shouldDumpUserGestureInFrameLoadCallbacks() const;

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp (142369 => 142370)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp	2013-02-09 18:41:26 UTC (rev 142369)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp	2013-02-09 18:55:36 UTC (rev 142370)
@@ -72,9 +72,9 @@
     m_interfaces->setTestIsRunning(running);
 }
 
-WebView* WebTestInterfaces::webView() const
+void WebTestInterfaces::configureForTestWithURL(const WebURL& testURL, bool generatePixels)
 {
-    return m_interfaces->webView();
+    m_interfaces->configureForTestWithURL(testURL, generatePixels);
 }
 
 WebTestRunner* WebTestInterfaces::testRunner()

Modified: trunk/Tools/DumpRenderTree/chromium/TestShell.cpp (142369 => 142370)


--- trunk/Tools/DumpRenderTree/chromium/TestShell.cpp	2013-02-09 18:41:26 UTC (rev 142369)
+++ trunk/Tools/DumpRenderTree/chromium/TestShell.cpp	2013-02-09 18:55:36 UTC (rev 142370)
@@ -263,13 +263,8 @@
     m_testInterfaces->setTestIsRunning(true);
     m_params = params;
     string testUrl = m_params.testUrl.spec();
+    m_testInterfaces->configureForTestWithURL(m_params.testUrl, shouldDumpPixels);
 
-    m_testInterfaces->testRunner()->setShouldGeneratePixelResults(shouldDumpPixels);
-
-    if (testUrl.find("loading/") != string::npos
-        || testUrl.find("loading\\") != string::npos)
-        m_testInterfaces->testRunner()->setShouldDumpFrameLoadCallbacks(true);
-
     if (testUrl.find("compositing/") != string::npos || testUrl.find("compositing\\") != string::npos) {
         if (!m_softwareCompositingEnabled)
             m_prefs.accelerated2dCanvasEnabled = true;
@@ -279,16 +274,6 @@
         m_prefs.applyTo(m_webView);
     }
 
-    if (testUrl.find("/dumpAsText/") != string::npos
-        || testUrl.find("\\dumpAsText\\") != string::npos) {
-        m_testInterfaces->testRunner()->setShouldDumpAsText(true);
-        m_testInterfaces->testRunner()->setShouldGeneratePixelResults(false);
-    }
-
-    if (testUrl.find("/inspector/") != string::npos
-        || testUrl.find("\\inspector\\") != string::npos)
-        showDevTools();
-
     if (m_dumpWhenFinished)
         m_printer.handleTestHeader(testUrl.c_str());
     loadURL(m_params.testUrl);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to