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

Unified Diff: chrome/browser/chromeos/events/event_rewriter_unittest.cc

Issue 2287403002: Create MouseWheelEvent directly instead of through MouseEvent. (Closed)
Patch Set: test Created 4 years, 4 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: chrome/browser/chromeos/events/event_rewriter_unittest.cc
diff --git a/chrome/browser/chromeos/events/event_rewriter_unittest.cc b/chrome/browser/chromeos/events/event_rewriter_unittest.cc
index 37eb1299fcc3f401ebd08b466337405b20792469..cb51678a9152d734fd6762d6dcbb40fad88b2e58 100644
--- a/chrome/browser/chromeos/events/event_rewriter_unittest.cc
+++ b/chrome/browser/chromeos/events/event_rewriter_unittest.cc
@@ -2421,10 +2421,10 @@ TEST_F(EventRewriterAshTest, MouseWheelEventDispatchImpl) {
ui::DomKey::CONTROL);
PopEvents(&events);
gfx::Point location(0, 0);
- ui::MouseEvent mev(ui::ET_MOUSEWHEEL, location, location,
- ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
- ui::EF_LEFT_MOUSE_BUTTON);
- ui::MouseWheelEvent positive(mev, 0, ui::MouseWheelEvent::kWheelDelta);
+ ui::MouseWheelEvent positive(
+ gfx::Vector2d(0, ui::MouseWheelEvent::kWheelDelta), location, location,
+ ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
+ ui::EF_LEFT_MOUSE_BUTTON);
ui::EventDispatchDetails details = Send(&positive);
ASSERT_FALSE(details.dispatcher_destroyed);
PopEvents(&events);
@@ -2440,7 +2440,10 @@ TEST_F(EventRewriterAshTest, MouseWheelEventDispatchImpl) {
SendActivateStickyKeyPattern(ui::VKEY_CONTROL, ui::DomCode::CONTROL_LEFT,
ui::DomKey::CONTROL);
PopEvents(&events);
- ui::MouseWheelEvent negative(mev, 0, -ui::MouseWheelEvent::kWheelDelta);
+ ui::MouseWheelEvent negative(
+ gfx::Vector2d(0, -ui::MouseWheelEvent::kWheelDelta), location, location,
+ ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
+ ui::EF_LEFT_MOUSE_BUTTON);
details = Send(&negative);
ASSERT_FALSE(details.dispatcher_destroyed);
PopEvents(&events);
@@ -2464,10 +2467,10 @@ TEST_F(EventRewriterAshTest, MouseWheelEventModifiersRewritten) {
// expect that it will be rewritten to ALT_DOWN.
ScopedVector<ui::Event> events;
gfx::Point location(0, 0);
- ui::MouseEvent mev(
- ui::ET_MOUSEWHEEL, location, location, ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON | ui::EF_CONTROL_DOWN, ui::EF_LEFT_MOUSE_BUTTON);
- ui::MouseWheelEvent positive(mev, 0, ui::MouseWheelEvent::kWheelDelta);
+ ui::MouseWheelEvent positive(
+ gfx::Vector2d(0, ui::MouseWheelEvent::kWheelDelta), location, location,
+ ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON | ui::EF_CONTROL_DOWN,
+ ui::EF_LEFT_MOUSE_BUTTON);
ui::EventDispatchDetails details = Send(&positive);
ASSERT_FALSE(details.dispatcher_destroyed);
PopEvents(&events);

Powered by Google App Engine
This is Rietveld 408576698