Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp (154719 => 154720)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp 2013-08-28 03:10:38 UTC (rev 154719)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp 2013-08-28 03:43:56 UTC (rev 154720)
@@ -105,14 +105,6 @@
}
EventSendingController::EventSendingController()
-#ifdef USE_WEBPROCESS_EVENT_SIMULATION
- : m_time(0)
- , m_position()
- , m_clickCount(0)
- , m_clickTime(0)
- , m_clickPosition()
- , m_clickButton(kWKEventMouseButtonNoButton)
-#endif
{
}
@@ -156,15 +148,10 @@
JSContextRef context = WKBundleFrameGetJavaScriptContext(frame);
WKEventModifiers modifiers = parseModifierArray(context, modifierArray);
-#ifdef USE_WEBPROCESS_EVENT_SIMULATION
- updateClickCount(button);
- WKBundlePageSimulateMouseDown(page, button, m_position, m_clickCount, modifiers, m_time);
-#else
WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, createMouseMessageBody(MouseDown, button, modifiers));
WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
-#endif
}
void EventSendingController::mouseUp(int button, JSValueRef modifierArray)
@@ -174,24 +161,14 @@
JSContextRef context = WKBundleFrameGetJavaScriptContext(frame);
WKEventModifiers modifiers = parseModifierArray(context, modifierArray);
-#ifdef USE_WEBPROCESS_EVENT_SIMULATION
- updateClickCount(button);
- WKBundlePageSimulateMouseUp(page, button, m_position, m_clickCount, modifiers, m_time);
-#else
WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, createMouseMessageBody(MouseUp, button, modifiers));
WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
-#endif
}
void EventSendingController::mouseMoveTo(int x, int y)
{
-#ifdef USE_WEBPROCESS_EVENT_SIMULATION
- m_position.x = x;
- m_position.y = y;
- WKBundlePageSimulateMouseMotion(InjectedBundle::shared().page()->page(), m_position, m_time);
-#else
WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
@@ -208,14 +185,10 @@
WKDictionaryAddItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
-#endif
}
void EventSendingController::leapForward(int milliseconds)
{
-#ifdef USE_WEBPROCESS_EVENT_SIMULATION
- m_time += milliseconds / 1000.0;
-#else
WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
@@ -228,7 +201,6 @@
WKDictionaryAddItem(EventSenderMessageBody.get(), timeKey.get(), timeRef.get());
WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
-#endif
}
void EventSendingController::scheduleAsynchronousClick()
@@ -365,22 +337,6 @@
#endif
}
-#ifdef USE_WEBPROCESS_EVENT_SIMULATION
-void EventSendingController::updateClickCount(WKEventMouseButton button)
-{
- if (m_time - m_clickTime < 1 && m_position == m_clickPosition && button == m_clickButton) {
- ++m_clickCount;
- m_clickTime = m_time;
- return;
- }
-
- m_clickCount = 1;
- m_clickTime = m_time;
- m_clickPosition = m_position;
- m_clickButton = button;
-}
-#endif
-
void EventSendingController::textZoomIn()
{
// Ensure page zoom is reset.
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (154719 => 154720)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2013-08-28 03:10:38 UTC (rev 154719)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2013-08-28 03:43:56 UTC (rev 154720)
@@ -26,6 +26,7 @@
#include "config.h"
#include "TestController.h"
+#include "EventSenderProxy.h"
#include "PlatformWebView.h"
#include "StringFunctions.h"
#include "TestInvocation.h"
@@ -54,10 +55,6 @@
#include <WebKit2/WKPagePrivateMac.h>
#endif
-#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
-#include "EventSenderProxy.h"
-#endif
-
#if !PLATFORM(MAC)
#include <WebKit2/WKTextChecker.h>
#endif
@@ -546,9 +543,7 @@
// FIXME: This function should also ensure that there is only one page open.
// Reset the EventSender for each test.
-#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
m_eventSenderProxy = adoptPtr(new EventSenderProxy(this));
-#endif
// Reset preferences
WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get());
@@ -834,7 +829,6 @@
void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
{
-#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
if (WKStringIsEqualToUTF8CString(messageName, "EventSender")) {
ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
@@ -867,7 +861,6 @@
ASSERT_NOT_REACHED();
}
-#endif
if (!m_currentInvocation)
return;
@@ -877,7 +870,6 @@
WKRetainPtr<WKTypeRef> TestController::didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
{
-#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
if (WKStringIsEqualToUTF8CString(messageName, "EventSender")) {
ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
@@ -1058,7 +1050,6 @@
#endif
ASSERT_NOT_REACHED();
}
-#endif
return m_currentInvocation->didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody);
}