Commit 9d2c818b authored by ap@apple.com's avatar ap@apple.com
Browse files

[WK2] Remove USE_WEBPROCESS_EVENT_SIMULATION

https://bugs.webkit.org/show_bug.cgi?id=120379

Reviewed by Darin Adler.

All major platforms have implemented UI process eventSender support, keeping old
web process side code only adds confusion.

* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::EventSendingController):
(WTR::EventSendingController::mouseDown):
(WTR::EventSendingController::mouseUp):
(WTR::EventSendingController::mouseMoveTo):
(WTR::EventSendingController::leapForward):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::didReceiveMessageFromInjectedBundle):
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/TestController.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 393177e7
2013-08-27 Alexey Proskuryakov <ap@apple.com>
[WK2] Remove USE_WEBPROCESS_EVENT_SIMULATION
https://bugs.webkit.org/show_bug.cgi?id=120379
Reviewed by Darin Adler.
All major platforms have implemented UI process eventSender support, keeping old
web process side code only adds confusion.
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::EventSendingController):
(WTR::EventSendingController::mouseDown):
(WTR::EventSendingController::mouseUp):
(WTR::EventSendingController::mouseMoveTo):
(WTR::EventSendingController::leapForward):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::didReceiveMessageFromInjectedBundle):
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/TestController.h:
2013-08-27 Roger Fong <roger_fong@apple.com>
NRWT on AppleWin port should delete semaphore lock files during cleanup tasks.
......
......@@ -105,14 +105,6 @@ PassRefPtr<EventSendingController> EventSendingController::create()
}
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 @@ void EventSendingController::mouseDown(int button, JSValueRef modifierArray)
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 @@ void EventSendingController::mouseUp(int button, JSValueRef modifierArray)
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 @@ void EventSendingController::mouseMoveTo(int x, int y)
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 @@ void EventSendingController::leapForward(int milliseconds)
WKDictionaryAddItem(EventSenderMessageBody.get(), timeKey.get(), timeRef.get());
WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
#endif
}
void EventSendingController::scheduleAsynchronousClick()
......@@ -365,22 +337,6 @@ JSValueRef EventSendingController::contextClick()
#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.
......
......@@ -31,10 +31,6 @@
#include <WebKit2/WKGeometry.h>
#include <wtf/PassRefPtr.h>
#if !PLATFORM(MAC) && !PLATFORM(QT) && !PLATFORM(GTK) && !PLATFORM(EFL)
#define USE_WEBPROCESS_EVENT_SIMULATION
#endif
namespace WTR {
class EventSendingController : public JSWrappable {
......@@ -83,18 +79,6 @@ public:
private:
EventSendingController();
#ifdef USE_WEBPROCESS_EVENT_SIMULATION
void updateClickCount(WKEventMouseButton);
double m_time;
WKPoint m_position;
int m_clickCount;
double m_clickTime;
WKPoint m_clickPosition;
WKEventMouseButton m_clickButton;
#endif
};
} // namespace WTR
......
......@@ -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 @@ bool TestController::resetStateToConsistentValues()
// 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::didReceiveKeyDownMessageFromInjectedBundle(WKDictionaryRef
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 @@ void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName
ASSERT_NOT_REACHED();
}
#endif
if (!m_currentInvocation)
return;
......@@ -877,7 +870,6 @@ void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName
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 @@ WKRetainPtr<WKTypeRef> TestController::didReceiveSynchronousMessageFromInjectedB
#endif
ASSERT_NOT_REACHED();
}
#endif
return m_currentInvocation->didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody);
}
......
......@@ -215,9 +215,7 @@ private:
bool m_shouldBlockAllPlugins;
#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
OwnPtr<EventSenderProxy> m_eventSenderProxy;
#endif
#if PLATFORM(QT)
class RunLoop;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment