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

Unified Diff: content/renderer/render_view_browsertest.cc

Issue 2569273002: Add constructors to WebInputEvents and setters so we can work at cleaning up these public structs. (Closed)
Patch Set: Rebase Created 3 years, 12 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
Index: content/renderer/render_view_browsertest.cc
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 28418a9bd5ef042aeacd384364d6b63009a6ed45..f2fc1de6575015c3d6b842a17719bdc84e879f87 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -80,6 +80,7 @@
#include "third_party/WebKit/public/web/WebSettings.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "third_party/WebKit/public/web/WebWindowFeatures.h"
+#include "ui/events/base_event_utils.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/codec/jpeg_codec.h"
@@ -1409,8 +1410,9 @@ TEST_F(RenderViewImplTest, ContextMenu) {
// Create a right click in the center of the iframe. (I'm hoping this will
// make this a bit more robust in case of some other formatting or other bug.)
- 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 = 250;
mouse_event.y = 250;
@@ -1420,7 +1422,7 @@ TEST_F(RenderViewImplTest, ContextMenu) {
SendWebMouseEvent(mouse_event);
// Now simulate the corresponding up event which should display the menu
- mouse_event.type = WebInputEvent::MouseUp;
+ mouse_event.setType(WebInputEvent::MouseUp);
SendWebMouseEvent(mouse_event);
EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching(

Powered by Google App Engine
This is Rietveld 408576698