Changeset 115071 in webkit
- Timestamp:
- Apr 24, 2012 9:28:20 AM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r115054 r115071 1 2012-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 1 26 2012-04-24 Mikhail Naganov <mnaganov@chromium.org> 2 27 -
trunk/Tools/WebKitTestRunner/EventSenderProxy.h
r108643 r115071 62 62 void updateTouchPoint(int index, int x, int y); 63 63 void setTouchModifier(WKEventModifiers, bool enable); 64 void setTouchPointRadius(int radiusX, int radiusY); 64 65 void touchStart(); 65 66 void touchMove(); … … 109 110 QList<QTouchEvent::TouchPoint> m_touchPoints; 110 111 Qt::KeyboardModifiers m_touchModifiers; 112 QPoint m_touchPointRadius; 111 113 bool m_touchActive; 112 114 #endif -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
r108643 r115071 48 48 void updateTouchPoint(in long index, in long x, in long y); 49 49 void setTouchModifier(in DOMString modifier, in boolean enable); 50 void setTouchPointRadius(in long radiusX, in long radiusY); 50 51 void touchStart(); 51 52 void touchMove(); -
trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
r113117 r115071 399 399 } 400 400 401 402 void 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 401 422 void EventSendingController::touchStart() 402 423 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h
r108643 r115071 68 68 void updateTouchPoint(int index, int x, int y); 69 69 void setTouchModifier(const JSStringRef &modifier, bool enable); 70 void setTouchPointRadius(int radiusX, int radiusY); 70 71 void touchStart(); 71 72 void touchMove(); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r114788 r115071 708 708 } 709 709 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 710 721 if (WKStringIsEqualToUTF8CString(subMessageName, "TouchStart")) { 711 722 WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true); -
trunk/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp
r108643 r115071 319 319 point.setStartPos(pos); 320 320 point.setState(Qt::TouchPointPressed); 321 if (!m_touchPointRadius.isNull()) 322 point.setRect(QRectF(pos - m_touchPointRadius, pos + m_touchPointRadius)); 321 323 m_touchPoints.append(point); 322 324 } … … 325 327 { 326 328 ASSERT(index >= 0 && index < m_touchPoints.count()); 329 QPointF pos(x, y); 327 330 QTouchEvent::TouchPoint &p = m_touchPoints[index]; 328 p.setPos( QPointF(x, y));331 p.setPos(pos); 329 332 p.setState(Qt::TouchPointMoved); 333 if (!m_touchPointRadius.isNull()) 334 p.setRect(QRectF(pos - m_touchPointRadius, pos + m_touchPointRadius)); 330 335 } 331 336 … … 338 343 else 339 344 m_touchModifiers &= ~mod; 345 } 346 347 void EventSenderProxy::setTouchPointRadius(int radiusX, int radiusY) 348 { 349 m_touchPointRadius = QPoint(radiusX, radiusY); 340 350 } 341 351 … … 377 387 m_touchModifiers = Qt::KeyboardModifiers(); 378 388 m_touchActive = false; 389 m_touchPointRadius = QPoint(); 379 390 } 380 391
Note: See TracChangeset
for help on using the changeset viewer.