Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2312)

Unified Diff: content/shell/renderer/test_runner/event_sender.cc

Issue 990183003: Added EventSender.setTouchPointRadius() for layoutTests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added myself to AUTHORS. Impl. of AddTouchPoint temporary reverted Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/renderer/test_runner/event_sender.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)) {
« no previous file with comments | « content/shell/renderer/test_runner/event_sender.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698