[chromium] move EventSender into TestRunner.a
[WebKit-https.git] / Tools / DumpRenderTree / chromium / TestRunner / TestInterfaces.cpp
index edd50df..6c23a28 100644 (file)
@@ -32,6 +32,7 @@
 #include "TestInterfaces.h"
 
 #include "AccessibilityController.h"
+#include "EventSender.h"
 #include "GamepadController.h"
 #include "TextInputController.h"
 #include "platform/WebString.h"
@@ -53,9 +54,11 @@ public:
     void resetAll();
 
     AccessibilityController* accessibilityController() { return m_accessibilityController.get(); }
+    EventSender* eventSender() { return m_eventSender.get(); }
 
 private:
     OwnPtr<AccessibilityController> m_accessibilityController;
+    OwnPtr<EventSender> m_eventSender;
     OwnPtr<GamepadController> m_gamepadController;
     OwnPtr<TextInputController> m_textInputController;
 };
@@ -63,6 +66,7 @@ private:
 TestInterfaces::Internal::Internal()
 {
     m_accessibilityController = adoptPtr(new AccessibilityController());
+    m_eventSender = adoptPtr(new EventSender());
     m_gamepadController = adoptPtr(new GamepadController());
     m_textInputController = adoptPtr(new TextInputController());
 }
@@ -70,10 +74,12 @@ TestInterfaces::Internal::Internal()
 TestInterfaces::Internal::~Internal()
 {
     m_accessibilityController->setWebView(0);
+    m_eventSender->setWebView(0);
     // m_gamepadController doesn't depend on WebView.
     m_textInputController->setWebView(0);
 
     // m_accessibilityController doesn't depend on TestDelegate.
+    m_eventSender->setDelegate(0);
     m_gamepadController->setDelegate(0);
     // m_textInputController doesn't depend on TestDelegate.
 }
@@ -81,6 +87,7 @@ TestInterfaces::Internal::~Internal()
 void TestInterfaces::Internal::setWebView(WebView* webView)
 {
     m_accessibilityController->setWebView(webView);
+    m_eventSender->setWebView(webView);
     // m_gamepadController doesn't depend on WebView.
     m_textInputController->setWebView(webView);
 }
@@ -88,6 +95,7 @@ void TestInterfaces::Internal::setWebView(WebView* webView)
 void TestInterfaces::Internal::setDelegate(TestDelegate* delegate)
 {
     // m_accessibilityController doesn't depend on TestDelegate.
+    m_eventSender->setDelegate(delegate);
     m_gamepadController->setDelegate(delegate);
     // m_textInputController doesn't depend on TestDelegate.
 }
@@ -95,6 +103,7 @@ void TestInterfaces::Internal::setDelegate(TestDelegate* delegate)
 void TestInterfaces::Internal::bindTo(WebFrame* frame)
 {
     m_accessibilityController->bindToJavascript(frame, WebString::fromUTF8("accessibilityController"));
+    m_eventSender->bindToJavascript(frame, WebString::fromUTF8("eventSender"));
     m_gamepadController->bindToJavascript(frame, WebString::fromUTF8("gamepadController"));
     m_textInputController->bindToJavascript(frame, WebString::fromUTF8("textInputController"));
 }
@@ -102,6 +111,7 @@ void TestInterfaces::Internal::bindTo(WebFrame* frame)
 void TestInterfaces::Internal::resetAll()
 {
     m_accessibilityController->reset();
+    m_eventSender->reset();
     m_gamepadController->reset();
     // m_textInputController doesn't have any state to reset.
 }
@@ -140,3 +150,8 @@ AccessibilityController* TestInterfaces::accessibilityController()
 {
     return m_internal->accessibilityController();
 }
+
+EventSender* TestInterfaces::eventSender()
+{
+    return m_internal->eventSender();
+}