Changeset 154720 in webkit
- Timestamp:
- Aug 27, 2013 8:43:56 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r154704 r154720 1 2013-08-27 Alexey Proskuryakov <ap@apple.com> 2 3 [WK2] Remove USE_WEBPROCESS_EVENT_SIMULATION 4 https://bugs.webkit.org/show_bug.cgi?id=120379 5 6 Reviewed by Darin Adler. 7 8 All major platforms have implemented UI process eventSender support, keeping old 9 web process side code only adds confusion. 10 11 * WebKitTestRunner/InjectedBundle/EventSendingController.cpp: 12 (WTR::EventSendingController::EventSendingController): 13 (WTR::EventSendingController::mouseDown): 14 (WTR::EventSendingController::mouseUp): 15 (WTR::EventSendingController::mouseMoveTo): 16 (WTR::EventSendingController::leapForward): 17 * WebKitTestRunner/InjectedBundle/EventSendingController.h: 18 * WebKitTestRunner/TestController.cpp: 19 (WTR::TestController::resetStateToConsistentValues): 20 (WTR::TestController::didReceiveMessageFromInjectedBundle): 21 (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle): 22 * WebKitTestRunner/TestController.h: 23 1 24 2013-08-27 Roger Fong <roger_fong@apple.com> 2 25 -
trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
r139242 r154720 106 106 107 107 EventSendingController::EventSendingController() 108 #ifdef USE_WEBPROCESS_EVENT_SIMULATION109 : m_time(0)110 , m_position()111 , m_clickCount(0)112 , m_clickTime(0)113 , m_clickPosition()114 , m_clickButton(kWKEventMouseButtonNoButton)115 #endif116 108 { 117 109 } … … 157 149 WKEventModifiers modifiers = parseModifierArray(context, modifierArray); 158 150 159 #ifdef USE_WEBPROCESS_EVENT_SIMULATION160 updateClickCount(button);161 WKBundlePageSimulateMouseDown(page, button, m_position, m_clickCount, modifiers, m_time);162 #else163 151 WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender")); 164 152 WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, createMouseMessageBody(MouseDown, button, modifiers)); 165 153 166 154 WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0); 167 #endif168 155 } 169 156 … … 175 162 WKEventModifiers modifiers = parseModifierArray(context, modifierArray); 176 163 177 #ifdef USE_WEBPROCESS_EVENT_SIMULATION178 updateClickCount(button);179 WKBundlePageSimulateMouseUp(page, button, m_position, m_clickCount, modifiers, m_time);180 #else181 164 WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender")); 182 165 WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, createMouseMessageBody(MouseUp, button, modifiers)); 183 166 184 167 WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0); 185 #endif186 168 } 187 169 188 170 void EventSendingController::mouseMoveTo(int x, int y) 189 171 { 190 #ifdef USE_WEBPROCESS_EVENT_SIMULATION191 m_position.x = x;192 m_position.y = y;193 WKBundlePageSimulateMouseMotion(InjectedBundle::shared().page()->page(), m_position, m_time);194 #else195 172 WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender")); 196 173 WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate()); … … 209 186 210 187 WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0); 211 #endif212 188 } 213 189 214 190 void EventSendingController::leapForward(int milliseconds) 215 191 { 216 #ifdef USE_WEBPROCESS_EVENT_SIMULATION217 m_time += milliseconds / 1000.0;218 #else219 192 WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender")); 220 193 WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate()); … … 229 202 230 203 WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0); 231 #endif232 204 } 233 205 … … 365 337 #endif 366 338 } 367 368 #ifdef USE_WEBPROCESS_EVENT_SIMULATION369 void EventSendingController::updateClickCount(WKEventMouseButton button)370 {371 if (m_time - m_clickTime < 1 && m_position == m_clickPosition && button == m_clickButton) {372 ++m_clickCount;373 m_clickTime = m_time;374 return;375 }376 377 m_clickCount = 1;378 m_clickTime = m_time;379 m_clickPosition = m_position;380 m_clickButton = button;381 }382 #endif383 339 384 340 void EventSendingController::textZoomIn() -
trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h
r139242 r154720 31 31 #include <WebKit2/WKGeometry.h> 32 32 #include <wtf/PassRefPtr.h> 33 34 #if !PLATFORM(MAC) && !PLATFORM(QT) && !PLATFORM(GTK) && !PLATFORM(EFL)35 #define USE_WEBPROCESS_EVENT_SIMULATION36 #endif37 33 38 34 namespace WTR { … … 84 80 private: 85 81 EventSendingController(); 86 87 #ifdef USE_WEBPROCESS_EVENT_SIMULATION88 void updateClickCount(WKEventMouseButton);89 90 double m_time;91 WKPoint m_position;92 93 int m_clickCount;94 double m_clickTime;95 WKPoint m_clickPosition;96 WKEventMouseButton m_clickButton;97 #endif98 82 }; 99 83 -
trunk/Tools/WebKitTestRunner/TestController.cpp
r154301 r154720 27 27 #include "TestController.h" 28 28 29 #include "EventSenderProxy.h" 29 30 #include "PlatformWebView.h" 30 31 #include "StringFunctions.h" … … 53 54 #if PLATFORM(MAC) 54 55 #include <WebKit2/WKPagePrivateMac.h> 55 #endif56 57 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)58 #include "EventSenderProxy.h"59 56 #endif 60 57 … … 547 544 548 545 // Reset the EventSender for each test. 549 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)550 546 m_eventSenderProxy = adoptPtr(new EventSenderProxy(this)); 551 #endif552 547 553 548 // Reset preferences … … 835 830 void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody) 836 831 { 837 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)838 832 if (WKStringIsEqualToUTF8CString(messageName, "EventSender")) { 839 833 ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID()); … … 868 862 ASSERT_NOT_REACHED(); 869 863 } 870 #endif871 864 872 865 if (!m_currentInvocation) … … 878 871 WKRetainPtr<WKTypeRef> TestController::didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody) 879 872 { 880 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)881 873 if (WKStringIsEqualToUTF8CString(messageName, "EventSender")) { 882 874 ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID()); … … 1059 1051 ASSERT_NOT_REACHED(); 1060 1052 } 1061 #endif1062 1053 return m_currentInvocation->didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody); 1063 1054 } -
trunk/Tools/WebKitTestRunner/TestController.h
r153054 r154720 216 216 bool m_shouldBlockAllPlugins; 217 217 218 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)219 218 OwnPtr<EventSenderProxy> m_eventSenderProxy; 220 #endif221 219 222 220 #if PLATFORM(QT)
Note: See TracChangeset
for help on using the changeset viewer.