Changeset 154720 in webkit


Ignore:
Timestamp:
Aug 27, 2013 8:43:56 PM (11 years ago)
Author:
ap@apple.com
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:
Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r154704 r154720  
     12013-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
    1242013-08-27  Roger Fong  <roger_fong@apple.com>
    225
  • trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp

    r139242 r154720  
    106106
    107107EventSendingController::EventSendingController()
    108 #ifdef USE_WEBPROCESS_EVENT_SIMULATION
    109     : m_time(0)
    110     , m_position()
    111     , m_clickCount(0)
    112     , m_clickTime(0)
    113     , m_clickPosition()
    114     , m_clickButton(kWKEventMouseButtonNoButton)
    115 #endif
    116108{
    117109}
     
    157149    WKEventModifiers modifiers = parseModifierArray(context, modifierArray);
    158150
    159 #ifdef USE_WEBPROCESS_EVENT_SIMULATION
    160     updateClickCount(button);
    161     WKBundlePageSimulateMouseDown(page, button, m_position, m_clickCount, modifiers, m_time);
    162 #else
    163151    WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    164152    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, createMouseMessageBody(MouseDown, button, modifiers));
    165153
    166154    WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    167 #endif
    168155}
    169156
     
    175162    WKEventModifiers modifiers = parseModifierArray(context, modifierArray);
    176163
    177 #ifdef USE_WEBPROCESS_EVENT_SIMULATION
    178     updateClickCount(button);
    179     WKBundlePageSimulateMouseUp(page, button, m_position, m_clickCount, modifiers, m_time);
    180 #else
    181164    WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    182165    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, createMouseMessageBody(MouseUp, button, modifiers));
    183166
    184167    WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    185 #endif
    186168}
    187169
    188170void EventSendingController::mouseMoveTo(int x, int y)
    189171{
    190 #ifdef USE_WEBPROCESS_EVENT_SIMULATION
    191     m_position.x = x;
    192     m_position.y = y;
    193     WKBundlePageSimulateMouseMotion(InjectedBundle::shared().page()->page(), m_position, m_time);
    194 #else
    195172    WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    196173    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
     
    209186
    210187    WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    211 #endif
    212188}
    213189
    214190void EventSendingController::leapForward(int milliseconds)
    215191{
    216 #ifdef USE_WEBPROCESS_EVENT_SIMULATION
    217     m_time += milliseconds / 1000.0;
    218 #else
    219192    WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
    220193    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
     
    229202
    230203    WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
    231 #endif
    232204}
    233205
     
    365337#endif
    366338}
    367 
    368 #ifdef USE_WEBPROCESS_EVENT_SIMULATION
    369 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 #endif
    383339
    384340void EventSendingController::textZoomIn()
  • trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h

    r139242 r154720  
    3131#include <WebKit2/WKGeometry.h>
    3232#include <wtf/PassRefPtr.h>
    33 
    34 #if !PLATFORM(MAC) && !PLATFORM(QT) && !PLATFORM(GTK) && !PLATFORM(EFL)
    35 #define USE_WEBPROCESS_EVENT_SIMULATION
    36 #endif
    3733
    3834namespace WTR {
     
    8480private:
    8581    EventSendingController();
    86 
    87 #ifdef USE_WEBPROCESS_EVENT_SIMULATION
    88     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 #endif
    9882};
    9983
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r154301 r154720  
    2727#include "TestController.h"
    2828
     29#include "EventSenderProxy.h"
    2930#include "PlatformWebView.h"
    3031#include "StringFunctions.h"
     
    5354#if PLATFORM(MAC)
    5455#include <WebKit2/WKPagePrivateMac.h>
    55 #endif
    56 
    57 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
    58 #include "EventSenderProxy.h"
    5956#endif
    6057
     
    547544
    548545    // Reset the EventSender for each test.
    549 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
    550546    m_eventSenderProxy = adoptPtr(new EventSenderProxy(this));
    551 #endif
    552547
    553548    // Reset preferences
     
    835830void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
    836831{
    837 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
    838832    if (WKStringIsEqualToUTF8CString(messageName, "EventSender")) {
    839833        ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
     
    868862        ASSERT_NOT_REACHED();
    869863    }
    870 #endif
    871864
    872865    if (!m_currentInvocation)
     
    878871WKRetainPtr<WKTypeRef> TestController::didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
    879872{
    880 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
    881873    if (WKStringIsEqualToUTF8CString(messageName, "EventSender")) {
    882874        ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
     
    10591051        ASSERT_NOT_REACHED();
    10601052    }
    1061 #endif
    10621053    return m_currentInvocation->didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody);
    10631054}
  • trunk/Tools/WebKitTestRunner/TestController.h

    r153054 r154720  
    216216    bool m_shouldBlockAllPlugins;
    217217
    218 #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
    219218    OwnPtr<EventSenderProxy> m_eventSenderProxy;
    220 #endif
    221219
    222220#if PLATFORM(QT)
Note: See TracChangeset for help on using the changeset viewer.