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

Side by Side Diff: chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Rebased, fixed a comment in web_input_event_builders_mac.mm Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 294 }
295 295
296 void SimulateRWHMouseClick(content::RenderWidgetHost* rwh, 296 void SimulateRWHMouseClick(content::RenderWidgetHost* rwh,
297 blink::WebMouseEvent::Button button, 297 blink::WebMouseEvent::Button button,
298 int x, 298 int x,
299 int y) { 299 int y) {
300 blink::WebMouseEvent mouse_event(blink::WebInputEvent::MouseDown, 300 blink::WebMouseEvent mouse_event(blink::WebInputEvent::MouseDown,
301 blink::WebInputEvent::NoModifiers, 301 blink::WebInputEvent::NoModifiers,
302 blink::WebInputEvent::TimeStampForTesting); 302 blink::WebInputEvent::TimeStampForTesting);
303 mouse_event.button = button; 303 mouse_event.button = button;
304 mouse_event.x = x; 304 mouse_event.setPositionInWidget(x, y);
305 mouse_event.y = y;
306 // Needed for the WebViewTest.ContextMenuPositionAfterCSSTransforms 305 // Needed for the WebViewTest.ContextMenuPositionAfterCSSTransforms
307 gfx::Rect rect = rwh->GetView()->GetViewBounds(); 306 gfx::Rect rect = rwh->GetView()->GetViewBounds();
308 mouse_event.globalX = x + rect.x(); 307 mouse_event.setPositionInScreen(x + rect.x(), y + rect.y());
309 mouse_event.globalY = y + rect.y();
310 rwh->ForwardMouseEvent(mouse_event); 308 rwh->ForwardMouseEvent(mouse_event);
311 mouse_event.setType(blink::WebInputEvent::MouseUp); 309 mouse_event.setType(blink::WebInputEvent::MouseUp);
312 rwh->ForwardMouseEvent(mouse_event); 310 rwh->ForwardMouseEvent(mouse_event);
313 } 311 }
314 312
315 class PopupCreatedObserver { 313 class PopupCreatedObserver {
316 public: 314 public:
317 PopupCreatedObserver() 315 PopupCreatedObserver()
318 : initial_widget_count_(0), 316 : initial_widget_count_(0),
319 last_render_widget_host_(NULL) {} 317 last_render_widget_host_(NULL) {}
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 // Get the input value from the guest. 1588 // Get the input value from the guest.
1591 value.clear(); 1589 value.clear();
1592 ASSERT_TRUE(ExecuteScriptAndExtractString(guest_web_contents, 1590 ASSERT_TRUE(ExecuteScriptAndExtractString(guest_web_contents,
1593 "window.domAutomationController." 1591 "window.domAutomationController."
1594 "send(document.querySelector('" 1592 "send(document.querySelector('"
1595 "input').value)", 1593 "input').value)",
1596 &value)); 1594 &value));
1597 EXPECT_EQ("A B C D", value); 1595 EXPECT_EQ("A B C D", value);
1598 } 1596 }
1599 #endif // OS_MACOSX 1597 #endif // OS_MACOSX
OLDNEW
« no previous file with comments | « chrome/browser/apps/guest_view/web_view_browsertest.cc ('k') | chrome/browser/chromeos/input_method/textinput_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698