Title: [139549] trunk/Tools
Revision
139549
Author
joc...@chromium.org
Date
2013-01-12 05:57:28 -0800 (Sat, 12 Jan 2013)

Log Message

[chromium] move inspector related methods to TestRunner library
https://bugs.webkit.org/show_bug.cgi?id=106654

Reviewed by Adam Barth.

* DumpRenderTree/chromium/DRTTestRunner.cpp:
(DRTTestRunner::DRTTestRunner):
* DumpRenderTree/chromium/DRTTestRunner.h:
(DRTTestRunner):
* DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
(WebTestRunner::WebTestDelegate::showDevTools):
(WebTestRunner::WebTestDelegate::closeDevTools):
(WebTestRunner::WebTestDelegate::evaluateInWebInspector):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::showWebInspector):
(WebTestRunner):
(WebTestRunner::TestRunner::closeWebInspector):
(WebTestRunner::TestRunner::evaluateInWebInspector):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(TestRunner):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::showDevTools):
(WebViewHost::closeDevTools):
(WebViewHost::evaluateInWebInspector):
* DumpRenderTree/chromium/WebViewHost.h:
(WebViewHost):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (139548 => 139549)


--- trunk/Tools/ChangeLog	2013-01-12 12:59:55 UTC (rev 139548)
+++ trunk/Tools/ChangeLog	2013-01-12 13:57:28 UTC (rev 139549)
@@ -1,3 +1,33 @@
+2013-01-12  Jochen Eisinger  <joc...@chromium.org>
+
+        [chromium] move inspector related methods to TestRunner library
+        https://bugs.webkit.org/show_bug.cgi?id=106654
+
+        Reviewed by Adam Barth.
+
+        * DumpRenderTree/chromium/DRTTestRunner.cpp:
+        (DRTTestRunner::DRTTestRunner):
+        * DumpRenderTree/chromium/DRTTestRunner.h:
+        (DRTTestRunner):
+        * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
+        (WebTestRunner::WebTestDelegate::showDevTools):
+        (WebTestRunner::WebTestDelegate::closeDevTools):
+        (WebTestRunner::WebTestDelegate::evaluateInWebInspector):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+        (WebTestRunner::TestRunner::TestRunner):
+        (WebTestRunner::TestRunner::showWebInspector):
+        (WebTestRunner):
+        (WebTestRunner::TestRunner::closeWebInspector):
+        (WebTestRunner::TestRunner::evaluateInWebInspector):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
+        (TestRunner):
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::showDevTools):
+        (WebViewHost::closeDevTools):
+        (WebViewHost::evaluateInWebInspector):
+        * DumpRenderTree/chromium/WebViewHost.h:
+        (WebViewHost):
+
 2013-01-11  Julie Parent  <jpar...@chromium.org>
 
         Builder should not be a valid parameter for stats dashboard

Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp (139548 => 139549)


--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp	2013-01-12 12:59:55 UTC (rev 139548)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp	2013-01-12 13:57:28 UTC (rev 139549)
@@ -107,7 +107,6 @@
     bindMethod("wasMockSpeechRecognitionAborted", &DRTTestRunner::wasMockSpeechRecognitionAborted);
 #endif
     bindMethod("clearAllDatabases", &DRTTestRunner::clearAllDatabases);
-    bindMethod("closeWebInspector", &DRTTestRunner::closeWebInspector);
 #if ENABLE(POINTER_LOCK)
     bindMethod("didAcquirePointerLock", &DRTTestRunner::didAcquirePointerLock);
     bindMethod("didLosePointerLock", &DRTTestRunner::didLosePointerLock);
@@ -119,7 +118,6 @@
     bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback);
     bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect);
     bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges);
-    bindMethod("evaluateInWebInspector", &DRTTestRunner::evaluateInWebInspector);
 #if ENABLE(NOTIFICATIONS)
     bindMethod("grantWebNotificationPermission", &DRTTestRunner::grantWebNotificationPermission);
 #endif
@@ -154,7 +152,6 @@
     bindMethod("setWillSendRequestReturnsNull", &DRTTestRunner::setWillSendRequestReturnsNull);
     bindMethod("setWillSendRequestReturnsNullOnRedirect", &DRTTestRunner::setWillSendRequestReturnsNullOnRedirect);
     bindMethod("setWindowIsKey", &DRTTestRunner::setWindowIsKey);
-    bindMethod("showWebInspector", &DRTTestRunner::showWebInspector);
 #if ENABLE(NOTIFICATIONS)
     bindMethod("simulateLegacyWebNotificationClick", &DRTTestRunner::simulateLegacyWebNotificationClick);
 #endif
@@ -492,18 +489,6 @@
     result->setNull();
 }
 
-void DRTTestRunner::showWebInspector(const CppArgumentList&, CppVariant* result)
-{
-    m_shell->showDevTools();
-    result->setNull();
-}
-
-void DRTTestRunner::closeWebInspector(const CppArgumentList& args, CppVariant* result)
-{
-    m_shell->closeDevTools();
-    result->setNull();
-}
-
 void DRTTestRunner::setWindowIsKey(const CppArgumentList& arguments, CppVariant* result)
 {
     if (arguments.size() > 0 && arguments[0].isBool())
@@ -700,14 +685,6 @@
     result->set(numberOfRequests);
 }
 
-void DRTTestRunner::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result)
-{
-    result->setNull();
-    if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString())
-        return;
-    m_shell->drtDevToolsAgent()->evaluateInWebInspector(arguments[0].toInt32(), arguments[1].toString());
-}
-
 void DRTTestRunner::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result)
 {
     result->setNull();

Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h (139548 => 139549)


--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2013-01-12 12:59:55 UTC (rev 139548)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2013-01-12 13:57:28 UTC (rev 139549)
@@ -111,10 +111,6 @@
     // Changes the cookie policy from the default to allow all cookies.
     void setAlwaysAcceptCookies(const CppArgumentList&, CppVariant*);
 
-    // Shows DevTools window.
-    void showWebInspector(const CppArgumentList&, CppVariant*);
-    void closeWebInspector(const CppArgumentList&, CppVariant*);
-
     // Gives focus to the window.
     void setWindowIsKey(const CppArgumentList&, CppVariant*);
 
@@ -170,9 +166,6 @@
     // Gets the number of geolocation permissions requests pending.
     void numberOfPendingGeolocationPermissionRequests(const CppArgumentList&, CppVariant*);
 
-    // Allows layout tests to exec scripts at WebInspector side.
-    void evaluateInWebInspector(const CppArgumentList&, CppVariant*);
-
     // DeviceOrientation related functions
     void setMockDeviceOrientation(const CppArgumentList&, CppVariant*);
 

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h (139548 => 139549)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h	2013-01-12 12:59:55 UTC (rev 139548)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h	2013-01-12 13:57:28 UTC (rev 139549)
@@ -82,6 +82,9 @@
     virtual void setClientWindowRect(const WebKit::WebRect&) { }
     virtual void setSelectTrailingWhitespaceEnabled(bool) { }
     virtual void setSmartInsertDeleteEnabled(bool) { }
+    virtual void showDevTools() { }
+    virtual void closeDevTools() { }
+    virtual void evaluateInWebInspector(long, const std::string&) { }
 };
 
 }

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (139548 => 139549)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2013-01-12 12:59:55 UTC (rev 139548)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2013-01-12 13:57:28 UTC (rev 139549)
@@ -165,6 +165,11 @@
     bindMethod("sendWebIntentResponse", &TestRunner::sendWebIntentResponse);
     bindMethod("deliverWebIntent", &TestRunner::deliverWebIntent);
 
+    // The following methods interact with the WebTestDelegate.
+    bindMethod("showWebInspector", &TestRunner::showWebInspector);
+    bindMethod("closeWebInspector", &TestRunner::closeWebInspector);
+    bindMethod("evaluateInWebInspector", &TestRunner::evaluateInWebInspector);
+
     // Properties.
     bindProperty("workerThreadCount", &TestRunner::workerThreadCount);
     bindProperty("globalFlag", &m_globalFlag);
@@ -1151,6 +1156,26 @@
     m_webView->mainFrame()->deliverIntent(intent, 0, m_intentClient.get());
 }
 
+void TestRunner::showWebInspector(const CppArgumentList&, CppVariant* result)
+{
+    m_delegate->showDevTools();
+    result->setNull();
+}
+
+void TestRunner::closeWebInspector(const CppArgumentList& args, CppVariant* result)
+{
+    m_delegate->closeDevTools();
+    result->setNull();
+}
+
+void TestRunner::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString())
+        return;
+    m_delegate->evaluateInWebInspector(arguments[0].toInt32(), arguments[1].toString());
+}
+
 void TestRunner::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result)
 {
     m_dumpEditingCallbacks = true;

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (139548 => 139549)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2013-01-12 12:59:55 UTC (rev 139548)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2013-01-12 13:57:28 UTC (rev 139549)
@@ -289,6 +289,16 @@
     void deliverWebIntent(const CppArgumentList&, CppVariant*);
 
     ///////////////////////////////////////////////////////////////////////////
+    // Methods forwarding to the WebTestDelegate
+
+    // Shows DevTools window.
+    void showWebInspector(const CppArgumentList&, CppVariant*);
+    void closeWebInspector(const CppArgumentList&, CppVariant*);
+
+    // Allows layout tests to exec scripts at WebInspector side.
+    void evaluateInWebInspector(const CppArgumentList&, CppVariant*);
+
+    ///////////////////////////////////////////////////////////////////////////
     // Properties
     void workerThreadCount(CppVariant*);
 

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (139548 => 139549)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2013-01-12 12:59:55 UTC (rev 139548)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2013-01-12 13:57:28 UTC (rev 139549)
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "WebViewHost.h"
 
+#include "DRTDevToolsAgent.h"
 #include "DRTTestRunner.h"
 #include "MockGrammarCheck.h"
 #include "MockWebSpeechInputController.h"
@@ -1063,6 +1064,21 @@
     return m_shell->normalizeLayoutTestURL(url);
 }
 
+void WebViewHost::showDevTools()
+{
+    m_shell->showDevTools();
+}
+
+void WebViewHost::closeDevTools()
+{
+    m_shell->closeDevTools();
+}
+
+void WebViewHost::evaluateInWebInspector(long callID, const std::string& script)
+{
+    m_shell->drtDevToolsAgent()->evaluateInWebInspector(callID, script);
+}
+
 // Public functions -----------------------------------------------------------
 
 WebViewHost::WebViewHost(TestShell* shell)

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.h (139548 => 139549)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.h	2013-01-12 12:59:55 UTC (rev 139548)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.h	2013-01-12 13:57:28 UTC (rev 139549)
@@ -151,6 +151,9 @@
     virtual void setSelectTrailingWhitespaceEnabled(bool) OVERRIDE;
     virtual void setSmartInsertDeleteEnabled(bool) OVERRIDE;
     virtual void setClientWindowRect(const WebKit::WebRect&) OVERRIDE;
+    virtual void showDevTools() OVERRIDE;
+    virtual void closeDevTools() OVERRIDE;
+    virtual void evaluateInWebInspector(long, const std::string&) OVERRIDE;
 
     // NavigationHost
     virtual bool navigate(const TestNavigationEntry&, bool reload);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to