Title: [122800] trunk/Tools
Revision
122800
Author
[email protected]
Date
2012-07-16 20:20:42 -0700 (Mon, 16 Jul 2012)

Log Message

[Chromium] Introduce TestInterfaces to hold all the _javascript_ interfaces needed for LayoutTests
https://bugs.webkit.org/show_bug.cgi?id=91312

Reviewed by Ryosuke Niwa.

Looking forward to moving more objects into TestRunner.a, we're going
to need an object to own all the interfaces and to put them through
their lifecycle.

* DumpRenderTree/DumpRenderTree.gypi:
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::initialize):
(TestShell::resetTestController):
(TestShell::bindJSObjectsToWindow):
* DumpRenderTree/chromium/TestShell.h:
(TestShell):
* DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp: Added.
* DumpRenderTree/chromium/TestRunner/TestInterfaces.h: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (122799 => 122800)


--- trunk/Tools/ChangeLog	2012-07-17 03:09:47 UTC (rev 122799)
+++ trunk/Tools/ChangeLog	2012-07-17 03:20:42 UTC (rev 122800)
@@ -1,3 +1,24 @@
+2012-07-16  Adam Barth  <[email protected]>
+
+        [Chromium] Introduce TestInterfaces to hold all the _javascript_ interfaces needed for LayoutTests
+        https://bugs.webkit.org/show_bug.cgi?id=91312
+
+        Reviewed by Ryosuke Niwa.
+
+        Looking forward to moving more objects into TestRunner.a, we're going
+        to need an object to own all the interfaces and to put them through
+        their lifecycle.
+
+        * DumpRenderTree/DumpRenderTree.gypi:
+        * DumpRenderTree/chromium/TestShell.cpp:
+        (TestShell::initialize):
+        (TestShell::resetTestController):
+        (TestShell::bindJSObjectsToWindow):
+        * DumpRenderTree/chromium/TestShell.h:
+        (TestShell):
+        * DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp: Added.
+        * DumpRenderTree/chromium/TestRunner/TestInterfaces.h: Added.
+
 2012-07-16  Ryuan Choi  <[email protected]>
 
         [EFL][WK2] Add APIs to support theme.

Modified: trunk/Tools/DumpRenderTree/DumpRenderTree.gypi (122799 => 122800)


--- trunk/Tools/DumpRenderTree/DumpRenderTree.gypi	2012-07-17 03:09:47 UTC (rev 122799)
+++ trunk/Tools/DumpRenderTree/DumpRenderTree.gypi	2012-07-17 03:20:42 UTC (rev 122800)
@@ -64,6 +64,8 @@
             'chromium/TestRunner/CppBoundClass.h',
             'chromium/TestRunner/CppVariant.cpp',
             'chromium/TestRunner/CppVariant.h',
+            'chromium/TestRunner/TestInterfaces.cpp',
+            'chromium/TestRunner/TestInterfaces.h',
             'chromium/TestRunner/GamepadController.cpp',
             'chromium/TestRunner/GamepadController.h',
         ],

Added: trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp (0 => 122800)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp	                        (rev 0)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp	2012-07-17 03:20:42 UTC (rev 122800)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TestInterfaces.h"
+
+#include "GamepadController.h"
+#include "platform/WebString.h"
+
+using WebKit::WebFrame;
+using WebKit::WebString;
+
+TestInterfaces::TestInterfaces()
+{
+    m_gamepadController = adoptPtr(new GamepadController());
+}
+
+TestInterfaces::~TestInterfaces()
+{
+}
+
+void TestInterfaces::bindTo(WebFrame* frame)
+{
+    m_gamepadController->bindToJavascript(frame, WebString::fromUTF8("gamepadController"));
+}
+
+void TestInterfaces::resetAll()
+{
+    m_gamepadController->reset();
+}

Added: trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h (0 => 122800)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h	                        (rev 0)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h	2012-07-17 03:20:42 UTC (rev 122800)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TestInterfaces_h
+#define TestInterfaces_h
+
+#include <wtf/OwnPtr.h>
+
+namespace WebKit {
+class WebFrame;
+}
+
+class GamepadController;
+
+class TestInterfaces {
+public:
+    TestInterfaces();
+    ~TestInterfaces();
+
+    void bindTo(WebKit::WebFrame*);
+    void resetAll();
+
+private:
+    OwnPtr<GamepadController> m_gamepadController;
+};
+
+#endif // TestInterfaces_h

Modified: trunk/Tools/DumpRenderTree/chromium/TestShell.cpp (122799 => 122800)


--- trunk/Tools/DumpRenderTree/chromium/TestShell.cpp	2012-07-17 03:09:47 UTC (rev 122799)
+++ trunk/Tools/DumpRenderTree/chromium/TestShell.cpp	2012-07-17 03:20:42 UTC (rev 122800)
@@ -147,8 +147,7 @@
 {
     m_webPermissions = adoptPtr(new WebPermissions(this));
     m_accessibilityController = adoptPtr(new AccessibilityController(this));
-    m_gamepadController = adoptPtr(new GamepadController());
-
+    m_testInterfaces = adoptPtr(new TestInterfaces());
     m_layoutTestController = adoptPtr(new LayoutTestController(this));
     m_eventSender = adoptPtr(new EventSender(this));
     m_textInputController = adoptPtr(new TextInputController(this));
@@ -296,7 +295,7 @@
     resetWebSettings(*webView());
     m_webPermissions->reset();
     m_accessibilityController->reset();
-    m_gamepadController->reset();
+    m_testInterfaces->resetAll();
     m_layoutTestController->reset();
     m_eventSender->reset();
     m_webViewHost->reset();
@@ -730,7 +729,7 @@
 {
     WebTestingSupport::injectInternalsObject(frame);
     m_accessibilityController->bindToJavascript(frame, WebString::fromUTF8("accessibilityController"));
-    m_gamepadController->bindToJavascript(frame, WebString::fromUTF8("gamepadController"));
+    m_testInterfaces->bindTo(frame);
     m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("layoutTestController"));
     m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("testRunner"));
     m_eventSender->bindToJavascript(frame, WebString::fromUTF8("eventSender"));

Modified: trunk/Tools/DumpRenderTree/chromium/TestShell.h (122799 => 122800)


--- trunk/Tools/DumpRenderTree/chromium/TestShell.h	2012-07-17 03:09:47 UTC (rev 122799)
+++ trunk/Tools/DumpRenderTree/chromium/TestShell.h	2012-07-17 03:20:42 UTC (rev 122800)
@@ -37,6 +37,7 @@
 #include "LayoutTestController.h"
 #include "NotificationPresenter.h"
 #include "TestEventPrinter.h"
+#include "TestInterfaces.h"
 #include "TextInputController.h"
 #include "WebPreferences.h"
 #include "WebViewHost.h"
@@ -95,7 +96,6 @@
     LayoutTestController* layoutTestController() const { return m_layoutTestController.get(); }
     EventSender* eventSender() const { return m_eventSender.get(); }
     AccessibilityController* accessibilityController() const { return m_accessibilityController.get(); }
-    GamepadController* gamepadController() const { return m_gamepadController.get(); }
 #if ENABLE(NOTIFICATIONS)
     NotificationPresenter* notificationPresenter() const { return m_notificationPresenter.get(); }
 #endif
@@ -216,7 +216,7 @@
     OwnPtr<DRTDevToolsAgent> m_drtDevToolsAgent;
     OwnPtr<DRTDevToolsClient> m_drtDevToolsClient;
     OwnPtr<AccessibilityController> m_accessibilityController;
-    OwnPtr<GamepadController> m_gamepadController;
+    OwnPtr<TestInterfaces> m_testInterfaces;
     OwnPtr<EventSender> m_eventSender;
     OwnPtr<LayoutTestController> m_layoutTestController;
     OwnPtr<TextInputController> m_textInputController;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to