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

Unified Diff: ash/sticky_keys/sticky_keys_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
« no previous file with comments | « no previous file | ash/wm/immersive_fullscreen_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/sticky_keys/sticky_keys_unittest.cc
diff --git a/ash/sticky_keys/sticky_keys_unittest.cc b/ash/sticky_keys/sticky_keys_unittest.cc
index fe61e6f5744beb5737193388dd69db1844d21d2e..457e3633961318cc8e67b23123e9401aa7f738d1 100644
--- a/ash/sticky_keys/sticky_keys_unittest.cc
+++ b/ash/sticky_keys/sticky_keys_unittest.cc
@@ -161,9 +161,16 @@ class StickyKeysTest : public test::AshTestBase {
// Creates a synthesized MouseEvent that is not backed by a native event.
ui::MouseEvent* GenerateSynthesizedMouseEventAt(ui::EventType event_type,
const gfx::Point& location) {
- ui::MouseEvent* event = new ui::MouseEvent(
- event_type, location, location, ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent* event;
+ if (event_type == ui::ET_MOUSEWHEEL) {
+ event = new ui::MouseWheelEvent(
+ gfx::Vector2d(), location, location, ui::EventTimeForNow(),
+ ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
+ } else {
+ event = new ui::MouseEvent(
+ event_type, location, location, ui::EventTimeForNow(),
+ ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
+ }
ui::Event::DispatcherApi dispatcher(event);
dispatcher.set_target(target_);
return event;
« no previous file with comments | « no previous file | ash/wm/immersive_fullscreen_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698