Chromium Code Reviews| Index: content/browser/renderer_host/input/input_router_impl_unittest.cc |
| diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc |
| index 564cdcff31fd8ded701249574a8f977f780261b1..a8bc67016508fe8267b41c6cd06d56b3fb069c51 100644 |
| --- a/content/browser/renderer_host/input/input_router_impl_unittest.cc |
| +++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc |
| @@ -33,6 +33,7 @@ |
| #include "content/public/test/mock_render_process_host.h" |
| #include "content/public/test/test_browser_context.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| +#include "ui/events/base_event_utils.h" |
| #include "ui/events/blink/web_input_event_traits.h" |
| #include "ui/events/keycodes/keyboard_codes.h" |
| @@ -84,7 +85,7 @@ WebInputEvent& GetEventWithType(WebInputEvent::Type type) { |
| event = &wheel; |
| } |
| CHECK(event); |
| - event->type = type; |
| + event->setType(type); |
| return *event; |
| } |
| @@ -185,10 +186,9 @@ class InputRouterImplTest : public testing::Test { |
| } |
| void SimulateKeyboardEvent(WebInputEvent::Type type) { |
| - WebKeyboardEvent event = SyntheticWebKeyboardEventBuilder::Build(type); |
| - NativeWebKeyboardEvent native_event; |
| - memcpy(&native_event, &event, sizeof(event)); |
| - NativeWebKeyboardEventWithLatencyInfo key_event(native_event); |
| + NativeWebKeyboardEventWithLatencyInfo key_event( |
| + type, WebInputEvent::NoModifiers, |
| + ui::EventTimeStampToSeconds(ui::EventTimeForNow()), ui::LatencyInfo()); |
|
majidvp
2016/12/19 20:09:52
Any idea why the original logic was doing rather c
dtapuska
2016/12/20 19:49:21
Because there wasn't a constructor on the NativeWe
|
| input_router_->SendKeyboardEvent(key_event); |
| } |