Changeset 115071 in webkit


Ignore:
Timestamp:
Apr 24, 2012 9:28:20 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt][WK2] Convert touch-point area
https://bugs.webkit.org/show_bug.cgi?id=84434

Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-04-24
Reviewed by Kenneth Rohde Christiansen.

Fix failing test after r114917 by also adding the new EventSender API
to WebKitTestRunner.

  • WebKitTestRunner/EventSenderProxy.h:

(EventSenderProxy):

  • WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
  • WebKitTestRunner/InjectedBundle/EventSendingController.cpp:

(WTR::EventSendingController::setTouchPointRadius):

  • WebKitTestRunner/InjectedBundle/EventSendingController.h:

(EventSendingController):

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):

  • WebKitTestRunner/qt/EventSenderProxyQt.cpp:

(WTR::EventSenderProxy::addTouchPoint):
(WTR::EventSenderProxy::updateTouchPoint):
(WTR::EventSenderProxy::setTouchPointRadius):
(WTR::EventSenderProxy::clearTouchPoints):

Location:
trunk/Tools
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r115054 r115071  
     12012-04-24  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        [Qt][WK2] Convert touch-point area
     4        https://bugs.webkit.org/show_bug.cgi?id=84434
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Fix failing test after r114917 by also adding the new EventSender API
     9        to WebKitTestRunner.
     10
     11        * WebKitTestRunner/EventSenderProxy.h:
     12        (EventSenderProxy):
     13        * WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
     14        * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
     15        (WTR::EventSendingController::setTouchPointRadius):
     16        * WebKitTestRunner/InjectedBundle/EventSendingController.h:
     17        (EventSendingController):
     18        * WebKitTestRunner/TestController.cpp:
     19        (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
     20        * WebKitTestRunner/qt/EventSenderProxyQt.cpp:
     21        (WTR::EventSenderProxy::addTouchPoint):
     22        (WTR::EventSenderProxy::updateTouchPoint):
     23        (WTR::EventSenderProxy::setTouchPointRadius):
     24        (WTR::EventSenderProxy::clearTouchPoints):
     25
    1262012-04-24  Mikhail Naganov  <mnaganov@chromium.org>
    227
  • trunk/Tools/WebKitTestRunner/EventSenderProxy.h

    r108643 r115071  
    6262    void updateTouchPoint(int index, int x, int y);
    6363    void setTouchModifier(WKEventModifiers, bool enable);
     64    void setTouchPointRadius(int radiusX, int radiusY);
    6465    void touchStart();
    6566    void touchMove();
     
    109110    QList<QTouchEvent::TouchPoint> m_touchPoints;
    110111    Qt::KeyboardModifiers m_touchModifiers;
     112    QPoint m_touchPointRadius;
    111113    bool m_touchActive;
    112114#endif
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl

    r108643 r115071  
    4848        void updateTouchPoint(in long index, in long x, in long y);
    4949        void setTouchModifier(in DOMString modifier, in boolean enable);
     50        void setTouchPointRadius(in long radiusX, in long radiusY);
    5051        void touchStart();
    5152        void touchMove();
  • trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp

    r113117 r115071  
    399399}
    400400
     401
     402void EventSendingController::setTouchPointRadius(int radiusX, int radiusY)
     403{
     404    WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
     405    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
     406
     407    WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
     408    WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("SetTouchPointRadius"));
     409    WKDictionaryAddItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
     410
     411    WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("RadiusX"));
     412    WKRetainPtr<WKUInt64Ref> xRef(AdoptWK, WKUInt64Create(radiusX));
     413    WKDictionaryAddItem(EventSenderMessageBody.get(), xKey.get(), xRef.get());
     414
     415    WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("RadiusY"));
     416    WKRetainPtr<WKUInt64Ref> yRef(AdoptWK, WKUInt64Create(radiusY));
     417    WKDictionaryAddItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
     418
     419    WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
     420}
     421
    401422void EventSendingController::touchStart()
    402423{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h

    r108643 r115071  
    6868    void updateTouchPoint(int index, int x, int y);
    6969    void setTouchModifier(const JSStringRef &modifier, bool enable);
     70    void setTouchPointRadius(int radiusX, int radiusY);
    7071    void touchStart();
    7172    void touchMove();
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r114788 r115071  
    708708        }
    709709
     710        if (WKStringIsEqualToUTF8CString(subMessageName, "SetTouchPointRadius")) {
     711            WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("RadiusX"));
     712            int x = static_cast<int>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, xKey.get()))));
     713
     714            WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("RadiusY"));
     715            int y = static_cast<int>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, yKey.get()))));
     716
     717            m_eventSenderProxy->setTouchPointRadius(x, y);
     718            return 0;
     719        }
     720
    710721        if (WKStringIsEqualToUTF8CString(subMessageName, "TouchStart")) {
    711722            WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
  • trunk/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp

    r108643 r115071  
    319319    point.setStartPos(pos);
    320320    point.setState(Qt::TouchPointPressed);
     321    if (!m_touchPointRadius.isNull())
     322        point.setRect(QRectF(pos - m_touchPointRadius, pos + m_touchPointRadius));
    321323    m_touchPoints.append(point);
    322324}
     
    325327{
    326328    ASSERT(index >= 0 && index < m_touchPoints.count());
     329    QPointF pos(x, y);
    327330    QTouchEvent::TouchPoint &p = m_touchPoints[index];
    328     p.setPos(QPointF(x, y));
     331    p.setPos(pos);
    329332    p.setState(Qt::TouchPointMoved);
     333    if (!m_touchPointRadius.isNull())
     334        p.setRect(QRectF(pos - m_touchPointRadius, pos + m_touchPointRadius));
    330335}
    331336
     
    338343    else
    339344        m_touchModifiers &= ~mod;
     345}
     346
     347void EventSenderProxy::setTouchPointRadius(int radiusX, int radiusY)
     348{
     349    m_touchPointRadius = QPoint(radiusX, radiusY);
    340350}
    341351
     
    377387    m_touchModifiers = Qt::KeyboardModifiers();
    378388    m_touchActive = false;
     389    m_touchPointRadius = QPoint();
    379390}
    380391
Note: See TracChangeset for help on using the changeset viewer.