Index: content/shell/renderer/test_runner/event_sender.cc |
diff --git a/content/shell/renderer/test_runner/event_sender.cc b/content/shell/renderer/test_runner/event_sender.cc |
index 8706b8643211bf3ce4311ce42c76519ff9a006de..e2bcaccf0c6636380273559dfaf0f3c3c25a1262 100644 |
--- a/content/shell/renderer/test_runner/event_sender.cc |
+++ b/content/shell/renderer/test_runner/event_sender.cc |
@@ -383,6 +383,10 @@ class EventSenderBindings : public gin::Wrappable<EventSenderBindings> { |
void ReleaseTouchPoint(unsigned index); |
void UpdateTouchPoint(unsigned index, double x, double y); |
void CancelTouchPoint(unsigned index); |
+ void SetTouchPointRadius(unsigned index, |
+ float rx, |
+ float ry, |
+ bool set_state_moved); |
void SetTouchModifier(const std::string& key_name, bool set_mask); |
void SetTouchCancelable(bool cancelable); |
void DumpFilenameBeingDragged(); |
@@ -518,6 +522,8 @@ EventSenderBindings::GetObjectTemplateBuilder(v8::Isolate* isolate) { |
.SetMethod("releaseTouchPoint", &EventSenderBindings::ReleaseTouchPoint) |
.SetMethod("updateTouchPoint", &EventSenderBindings::UpdateTouchPoint) |
.SetMethod("cancelTouchPoint", &EventSenderBindings::CancelTouchPoint) |
+ .SetMethod("setTouchPointRadius", |
+ &EventSenderBindings::SetTouchPointRadius) |
.SetMethod("setTouchModifier", &EventSenderBindings::SetTouchModifier) |
.SetMethod("setTouchCancelable", &EventSenderBindings::SetTouchCancelable) |
.SetMethod("dumpFilenameBeingDragged", |
@@ -707,6 +713,14 @@ void EventSenderBindings::CancelTouchPoint(unsigned index) { |
sender_->CancelTouchPoint(index); |
} |
+void EventSenderBindings::SetTouchPointRadius(unsigned index, |
+ float rx, |
+ float ry, |
+ bool set_state_moved) { |
+ if (sender_) |
+ sender_->SetTouchPointRadius(index, rx, ry, set_state_moved); |
+} |
+ |
void EventSenderBindings::SetTouchModifier(const std::string& key_name, |
bool set_mask) { |
if (sender_) |
@@ -1611,6 +1625,22 @@ void EventSender::CancelTouchPoint(unsigned index) { |
touch_point->state = WebTouchPoint::StateCancelled; |
} |
+void EventSender::SetTouchPointRadius(unsigned index, |
+ float rx, |
+ float ry, |
+ bool set_state_moved) { |
+ if (index >= touch_points_.size()) { |
+ ThrowTouchPointError(); |
+ return; |
+ } |
+ |
+ WebTouchPoint* touch_point = &touch_points_[index]; |
+ if (set_state_moved) |
+ touch_point->state = WebTouchPoint::StateMoved; |
+ touch_point->radiusX = rx; |
+ touch_point->radiusY = ry; |
+} |
+ |
void EventSender::SetTouchModifier(const std::string& key_name, |
bool set_mask) { |
int mask = 0; |
@@ -1770,6 +1800,7 @@ void EventSender::AddTouchPoint(gin::Arguments* args) { |
static_cast<float>(y)); |
touch_point.screenPosition = touch_point.position; |
+ // TODO: remove this after blink patch #990193002 be landed |
if (!args->PeekNext().IsEmpty()) { |
double radius_x; |
if (!args->GetNext(&radius_x)) { |