Title: [134203] trunk/Tools
Revision
134203
Author
[email protected]
Date
2012-11-12 03:42:37 -0800 (Mon, 12 Nov 2012)

Log Message

[chromium] move TestRunner implementation into WebTestRunner namespace
https://bugs.webkit.org/show_bug.cgi?id=101837

Reviewed by Adam Barth.

That way, we don't get collisions when linking e.g. against chromium's
net test support library.

* DumpRenderTree/chromium/DRTTestRunner.h:
(DRTTestRunner):
* DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/CppVariant.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/EventSender.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/GamepadController.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestDelegate.h:
(WebTestRunner):
(TestDelegate):
* DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h:
(WebTestRunner):
(TestInterfaces):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TextInputController.h:
(WebTestRunner):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (134202 => 134203)


--- trunk/Tools/ChangeLog	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/ChangeLog	2012-11-12 11:42:37 UTC (rev 134203)
@@ -1,3 +1,52 @@
+2012-11-12  Jochen Eisinger  <[email protected]>
+
+        [chromium] move TestRunner implementation into WebTestRunner namespace
+        https://bugs.webkit.org/show_bug.cgi?id=101837
+
+        Reviewed by Adam Barth.
+
+        That way, we don't get collisions when linking e.g. against chromium's
+        net test support library.
+
+        * DumpRenderTree/chromium/DRTTestRunner.h:
+        (DRTTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/CppVariant.h:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/EventSender.h:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/GamepadController.h:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/TestDelegate.h:
+        (WebTestRunner):
+        (TestDelegate):
+        * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h:
+        (WebTestRunner):
+        (TestInterfaces):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp:
+        (WebTestRunner):
+        * DumpRenderTree/chromium/TestRunner/src/TextInputController.h:
+        (WebTestRunner):
+
 2012-11-12  Zeno Albisser  <[email protected]>
 
         [Qt] MiniBrowser should not strongly depend on QtTestSupport.

Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h	2012-11-12 11:42:37 UTC (rev 134203)
@@ -63,7 +63,10 @@
 
 class TestShell;
 
-class DRTTestRunner : public TestRunner {
+using WebTestRunner::CppArgumentList;
+using WebTestRunner::CppVariant;
+
+class DRTTestRunner : public WebTestRunner::TestRunner {
 public:
     // Builds the property and method lists needed to bind this class to a JS
     // object.

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h	2012-11-12 11:42:37 UTC (rev 134203)
@@ -40,10 +40,10 @@
 class WebView;
 }
 
+namespace WebTestRunner {
+
 class TestDelegate;
 
-namespace WebTestRunner {
-
 class AccessibilityController : public CppBoundClass {
 public:
     AccessibilityController();

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp	2012-11-12 11:42:37 UTC (rev 134203)
@@ -42,9 +42,13 @@
 using namespace WebKit;
 using namespace std;
 
+namespace WebTestRunner {
+
+namespace {
+
 // Map role value to string, matching Safari/Mac platform implementation to
 // avoid rebaselining layout tests.
-static string roleToString(WebAccessibilityRole role)
+string roleToString(WebAccessibilityRole role)
 {
     string result = "AXRole: AX";
     switch (role) {
@@ -347,6 +351,8 @@
     string m_attributes;
 };
 
+}
+
 AccessibilityUIElement::AccessibilityUIElement(const WebAccessibilityObject& object, Factory* factory)
     : m_accessibilityObject(object)
     , m_factory(factory)
@@ -972,3 +978,5 @@
     m_elements.append(element);
     return element;
 }
+
+}

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h	2012-11-12 11:42:37 UTC (rev 134203)
@@ -36,6 +36,8 @@
 #include <vector>
 #include <wtf/Vector.h>
 
+namespace WebTestRunner {
+
 class AccessibilityUIElement : public CppBoundClass {
 public:
     class Factory {
@@ -166,4 +168,6 @@
     ElementList m_elements;
 };
 
+}
+
 #endif // AccessibilityUIElementChromium_h

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp	2012-11-12 11:42:37 UTC (rev 134203)
@@ -51,6 +51,10 @@
 using namespace WebKit;
 using namespace std;
 
+namespace WebTestRunner {
+
+namespace {
+
 class CppVariantPropertyCallback : public CppBoundClass::PropertyCallback {
 public:
     CppVariantPropertyCallback(CppVariant* value) : m_value(value) { }
@@ -90,6 +94,8 @@
     OwnPtr<CppBoundClass::GetterCallback> m_callback;
 };
 
+}
+
 // Our special NPObject type. We extend an NPObject with a pointer to a
 // CppBoundClass, which is just a C++ interface that we forward all NPObject
 // callbacks to.
@@ -350,3 +356,5 @@
     frame->bindToWindowObject(classname, NPVARIANT_TO_OBJECT(*getAsCppVariant()));
     m_boundToFrame = true;
 }
+
+}

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h	2012-11-12 11:42:37 UTC (rev 134203)
@@ -55,6 +55,8 @@
 class WebString;
 }
 
+namespace WebTestRunner {
+
 typedef Vector<CppVariant> CppArgumentList;
 
 // CppBoundClass lets you map _javascript_ method calls and property accesses
@@ -242,4 +244,6 @@
     bool m_boundToFrame;
 };
 
+}
+
 #endif // CppBoundClass_h

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp	2012-11-12 11:42:37 UTC (rev 134203)
@@ -39,6 +39,8 @@
 using namespace WebKit;
 using namespace std;
 
+namespace WebTestRunner {
+
 CppVariant::CppVariant()
 {
     type = NPVariantType_Null;
@@ -319,3 +321,5 @@
     result.set(r);
     return status;
 }
+
+}

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h	2012-11-12 11:42:37 UTC (rev 134203)
@@ -46,6 +46,8 @@
 #include <string>
 #include <wtf/Vector.h>
 
+namespace WebTestRunner {
+
 class CppVariant : public NPVariant {
 public:
     CppVariant();
@@ -137,4 +139,6 @@
                        uint32_t argumentCount, CppVariant& result) const;
 };
 
+}
+
 #endif // CppVariant_h

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.h (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.h	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.h	2012-11-12 11:42:37 UTC (rev 134203)
@@ -48,10 +48,10 @@
 class WebView;
 }
 
+namespace WebTestRunner {
+
 class TestDelegate;
 
-namespace WebTestRunner {
-
 class EventSender : public CppBoundClass {
 public:
     EventSender();

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp	2012-11-12 11:42:37 UTC (rev 134203)
@@ -34,6 +34,8 @@
 
 using namespace WebKit;
 
+namespace WebTestRunner {
+
 GamepadController::GamepadController()
 {
     bindMethod("connect", &GamepadController::connect);
@@ -193,3 +195,5 @@
     m_delegate->printMessage("CONSOLE MESSAGE: _javascript_ ERROR: unknown method called on GamepadController\n");
     result->setNull();
 }
+
+}

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.h (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.h	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/GamepadController.h	2012-11-12 11:42:37 UTC (rev 134203)
@@ -34,13 +34,15 @@
 #include "CppBoundClass.h"
 #include "platform/WebGamepads.h"
 
-class TestDelegate;
-
 namespace WebKit {
 class WebGamepads;
 class WebFrame;
 }
 
+namespace WebTestRunner {
+
+class TestDelegate;
+
 class GamepadController : public CppBoundClass {
 public:
     GamepadController();
@@ -65,4 +67,6 @@
     TestDelegate* m_delegate;
 };
 
+}
+
 #endif // GamepadController_h

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h	2012-11-12 11:42:37 UTC (rev 134203)
@@ -40,8 +40,8 @@
 }
 
 namespace WebTestRunner {
+
 class WebTask;
-}
 
 class TestDelegate {
 public:
@@ -52,11 +52,13 @@
     virtual WebKit::WebContextMenuData* lastContextMenuData() const = 0;
     virtual void setGamepadData(const WebKit::WebGamepads&) = 0;
     virtual void printMessage(const std::string& message) = 0;
-    virtual void postTask(WebTestRunner::WebTask*) = 0;
-    virtual void postDelayedTask(WebTestRunner::WebTask*, long long ms) = 0;
+    virtual void postTask(WebTask*) = 0;
+    virtual void postDelayedTask(WebTask*, long long ms) = 0;
     virtual WebKit::WebString registerIsolatedFileSystem(const WebKit::WebVector<WebKit::WebString>& absoluteFilenames) = 0;
     virtual long long getCurrentTimeInMillisecond() = 0;
     virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path(const std::string& path) = 0;
 };
 
+}
+
 #endif // TestDelegate_h

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


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp	2012-11-12 11:42:37 UTC (rev 134203)
@@ -37,12 +37,12 @@
 #include "TextInputController.h"
 #include "platform/WebString.h"
 
-using WebTestRunner::AccessibilityController;
-using WebTestRunner::EventSender;
 using WebKit::WebFrame;
 using WebKit::WebString;
 using WebKit::WebView;
 
+namespace WebTestRunner {
+
 TestInterfaces::TestInterfaces()
 {
     m_accessibilityController = adoptPtr(new AccessibilityController());
@@ -105,3 +105,5 @@
 {
     return m_eventSender.get();
 }
+
+}

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


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h	2012-11-12 11:42:37 UTC (rev 134203)
@@ -39,10 +39,9 @@
 }
 
 namespace WebTestRunner {
+
 class AccessibilityController;
 class EventSender;
-}
-
 class GamepadController;
 class TestDelegate;
 class TextInputController;
@@ -57,14 +56,16 @@
     void bindTo(WebKit::WebFrame*);
     void resetAll();
 
-    WebTestRunner::AccessibilityController* accessibilityController();
-    WebTestRunner::EventSender* eventSender();
+    AccessibilityController* accessibilityController();
+    EventSender* eventSender();
 
 private:
-    OwnPtr<WebTestRunner::AccessibilityController> m_accessibilityController;
-    OwnPtr<WebTestRunner::EventSender> m_eventSender;
+    OwnPtr<AccessibilityController> m_accessibilityController;
+    OwnPtr<EventSender> m_eventSender;
     OwnPtr<GamepadController> m_gamepadController;
     OwnPtr<TextInputController> m_textInputController;
 };
 
+}
+
 #endif // TestInterfaces_h

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp	2012-11-12 11:42:37 UTC (rev 134203)
@@ -32,6 +32,10 @@
 #include "config.h"
 #include "TestRunner.h"
 
+namespace WebTestRunner {
+
 TestRunner::TestRunner()
 {
 }
+
+}

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h	2012-11-12 11:42:37 UTC (rev 134203)
@@ -34,9 +34,13 @@
 
 #include "CppBoundClass.h"
 
+namespace WebTestRunner {
+
 class TestRunner : public CppBoundClass {
 public:
     TestRunner();
 };
 
+}
+
 #endif // TestRunner_h

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp	2012-11-12 11:42:37 UTC (rev 134203)
@@ -44,6 +44,8 @@
 
 using namespace WebKit;
 
+namespace WebTestRunner {
+
 TextInputController::TextInputController()
 {
     bindMethod("attributedSubstringFromRange", &TextInputController::attributedSubstringFromRange);
@@ -231,3 +233,5 @@
     WebString text(WebString::fromUTF8(arguments[0].toString()));
     m_webView->setComposition(text, underlines, 0, text.length());
 }
+
+}

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.h (134202 => 134203)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.h	2012-11-12 11:23:11 UTC (rev 134202)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TextInputController.h	2012-11-12 11:42:37 UTC (rev 134203)
@@ -41,6 +41,8 @@
 class WebView;
 }
 
+namespace WebTestRunner {
+
 class TextInputController : public CppBoundClass {
 public:
     TextInputController();
@@ -67,4 +69,6 @@
     WebKit::WebView* m_webView;
 };
 
+}
+
 #endif // TextInputController_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to