| Index: content/public/test/render_view_test.cc
|
| diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc
|
| index c7f16dac011d375c581dc4fe138b6405789195d8..595c0cb70fe6360a99a0b6e48844527f9ab22b60 100644
|
| --- a/content/public/test/render_view_test.cc
|
| +++ b/content/public/test/render_view_test.cc
|
| @@ -51,6 +51,7 @@
|
| #include "third_party/WebKit/public/web/WebScriptSource.h"
|
| #include "third_party/WebKit/public/web/WebView.h"
|
| #include "ui/base/resource/resource_bundle.h"
|
| +#include "ui/events/base_event_utils.h"
|
| #include "ui/events/keycodes/keyboard_codes.h"
|
| #include "v8/include/v8.h"
|
|
|
| @@ -449,8 +450,9 @@ bool RenderViewTest::SimulateElementClick(const std::string& element_id) {
|
| }
|
|
|
| void RenderViewTest::SimulatePointClick(const gfx::Point& point) {
|
| - WebMouseEvent mouse_event;
|
| - mouse_event.type = WebInputEvent::MouseDown;
|
| + WebMouseEvent mouse_event(WebInputEvent::MouseDown,
|
| + WebInputEvent::NoModifiers,
|
| + ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
|
| mouse_event.button = WebMouseEvent::Button::Left;
|
| mouse_event.x = point.x();
|
| mouse_event.y = point.y();
|
| @@ -459,7 +461,7 @@ void RenderViewTest::SimulatePointClick(const gfx::Point& point) {
|
| impl->OnMessageReceived(InputMsg_HandleInputEvent(
|
| 0, &mouse_event, ui::LatencyInfo(),
|
| InputEventDispatchType::DISPATCH_TYPE_BLOCKING));
|
| - mouse_event.type = WebInputEvent::MouseUp;
|
| + mouse_event.setType(WebInputEvent::MouseUp);
|
| impl->OnMessageReceived(InputMsg_HandleInputEvent(
|
| 0, &mouse_event, ui::LatencyInfo(),
|
| InputEventDispatchType::DISPATCH_TYPE_BLOCKING));
|
| @@ -475,8 +477,9 @@ bool RenderViewTest::SimulateElementRightClick(const std::string& element_id) {
|
| }
|
|
|
| void RenderViewTest::SimulatePointRightClick(const gfx::Point& point) {
|
| - WebMouseEvent mouse_event;
|
| - mouse_event.type = WebInputEvent::MouseDown;
|
| + WebMouseEvent mouse_event(WebInputEvent::MouseDown,
|
| + WebInputEvent::NoModifiers,
|
| + ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
|
| mouse_event.button = WebMouseEvent::Button::Right;
|
| mouse_event.x = point.x();
|
| mouse_event.y = point.y();
|
| @@ -485,20 +488,21 @@ void RenderViewTest::SimulatePointRightClick(const gfx::Point& point) {
|
| impl->OnMessageReceived(InputMsg_HandleInputEvent(
|
| 0, &mouse_event, ui::LatencyInfo(),
|
| InputEventDispatchType::DISPATCH_TYPE_BLOCKING));
|
| - mouse_event.type = WebInputEvent::MouseUp;
|
| + mouse_event.setType(WebInputEvent::MouseUp);
|
| impl->OnMessageReceived(InputMsg_HandleInputEvent(
|
| 0, &mouse_event, ui::LatencyInfo(),
|
| InputEventDispatchType::DISPATCH_TYPE_BLOCKING));
|
| }
|
|
|
| void RenderViewTest::SimulateRectTap(const gfx::Rect& rect) {
|
| - WebGestureEvent gesture_event;
|
| + WebGestureEvent gesture_event(
|
| + WebInputEvent::GestureTap, WebInputEvent::NoModifiers,
|
| + ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
|
| gesture_event.x = rect.CenterPoint().x();
|
| gesture_event.y = rect.CenterPoint().y();
|
| gesture_event.data.tap.tapCount = 1;
|
| gesture_event.data.tap.width = rect.width();
|
| gesture_event.data.tap.height = rect.height();
|
| - gesture_event.type = WebInputEvent::GestureTap;
|
| gesture_event.sourceDevice = blink::WebGestureDeviceTouchpad;
|
| RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
|
| impl->OnMessageReceived(InputMsg_HandleInputEvent(
|
| @@ -547,21 +551,23 @@ void RenderViewTest::Resize(gfx::Size new_size,
|
|
|
| void RenderViewTest::SimulateUserTypingASCIICharacter(char ascii_character,
|
| bool flush_message_loop) {
|
| - blink::WebKeyboardEvent event;
|
| - event.text[0] = ascii_character;
|
| - ASSERT_TRUE(GetWindowsKeyCode(ascii_character, &event.windowsKeyCode));
|
| + int modifiers = blink::WebInputEvent::NoModifiers;
|
| if (isupper(ascii_character) || ascii_character == '@' ||
|
| ascii_character == '_') {
|
| - event.modifiers = blink::WebKeyboardEvent::ShiftKey;
|
| + modifiers = blink::WebKeyboardEvent::ShiftKey;
|
| }
|
|
|
| - event.type = blink::WebKeyboardEvent::RawKeyDown;
|
| + blink::WebKeyboardEvent event(
|
| + blink::WebKeyboardEvent::RawKeyDown, modifiers,
|
| + ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
|
| + event.text[0] = ascii_character;
|
| + ASSERT_TRUE(GetWindowsKeyCode(ascii_character, &event.windowsKeyCode));
|
| SendWebKeyboardEvent(event);
|
|
|
| - event.type = blink::WebKeyboardEvent::Char;
|
| + event.setType(blink::WebKeyboardEvent::Char);
|
| SendWebKeyboardEvent(event);
|
|
|
| - event.type = blink::WebKeyboardEvent::KeyUp;
|
| + event.setType(blink::WebKeyboardEvent::KeyUp);
|
| SendWebKeyboardEvent(event);
|
|
|
| if (flush_message_loop) {
|
|
|