Title: [154720] trunk/Tools
Revision
154720
Author
[email protected]
Date
2013-08-27 20:43:56 -0700 (Tue, 27 Aug 2013)

Log Message

[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:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (154719 => 154720)


--- trunk/Tools/ChangeLog	2013-08-28 03:10:38 UTC (rev 154719)
+++ trunk/Tools/ChangeLog	2013-08-28 03:43:56 UTC (rev 154720)
@@ -1,3 +1,26 @@
+2013-08-27  Alexey Proskuryakov  <[email protected]>
+
+        [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  <[email protected]>
 
         NRWT on AppleWin port should delete semaphore lock files during cleanup tasks.

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/InjectedBundle/EventSendingController.h (154719 => 154720)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h	2013-08-28 03:10:38 UTC (rev 154719)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h	2013-08-28 03:43:56 UTC (rev 154720)
@@ -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 @@
 
 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

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);
 }
 

Modified: trunk/Tools/WebKitTestRunner/TestController.h (154719 => 154720)


--- trunk/Tools/WebKitTestRunner/TestController.h	2013-08-28 03:10:38 UTC (rev 154719)
+++ trunk/Tools/WebKitTestRunner/TestController.h	2013-08-28 03:43:56 UTC (rev 154720)
@@ -215,9 +215,7 @@
 
     bool m_shouldBlockAllPlugins;
 
-#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
     OwnPtr<EventSenderProxy> m_eventSenderProxy;
-#endif
 
 #if PLATFORM(QT)
     class RunLoop;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to