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

Unified Diff: content/browser/renderer_host/input/input_router_impl_unittest.cc

Issue 2569273002: Add constructors to WebInputEvents and setters so we can work at cleaning up these public structs. (Closed)
Patch Set: Fix mouse up event sender not modifying modifiers Created 4 years 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
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);
}

Powered by Google App Engine
This is Rietveld 408576698