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

Side by Side Diff: ash/wm/sticky_keys_unittest.cc

Issue 101573006: Changes MouseEvent constructor to take changed_button_flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test; needs updated expectations as mouse entered wasnt sent before because of env::mouse_butto… Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/sticky_keys.h" 5 #include "ash/wm/sticky_keys.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 #undef None 8 #undef None
9 #undef Bool 9 #undef Bool
10 #undef RootWindow 10 #undef RootWindow
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 dispatcher.set_target(target_); 228 dispatcher.set_target(target_);
229 return event; 229 return event;
230 } 230 }
231 231
232 // Creates a synthesized MouseEvent that is not backed by a native event. 232 // Creates a synthesized MouseEvent that is not backed by a native event.
233 ui::MouseEvent* GenerateSynthesizedMouseEvent(bool is_button_press) { 233 ui::MouseEvent* GenerateSynthesizedMouseEvent(bool is_button_press) {
234 ui::MouseEvent* event = new ui::MouseEvent( 234 ui::MouseEvent* event = new ui::MouseEvent(
235 is_button_press ? ui::ET_MOUSE_PRESSED : ui::ET_MOUSE_RELEASED, 235 is_button_press ? ui::ET_MOUSE_PRESSED : ui::ET_MOUSE_RELEASED,
236 gfx::Point(0, 0), 236 gfx::Point(0, 0),
237 gfx::Point(0, 0), 237 gfx::Point(0, 0),
238 ui::EF_LEFT_MOUSE_BUTTON,
238 ui::EF_LEFT_MOUSE_BUTTON); 239 ui::EF_LEFT_MOUSE_BUTTON);
239 ui::Event::DispatcherApi dispatcher(event); 240 ui::Event::DispatcherApi dispatcher(event);
240 dispatcher.set_target(target_); 241 dispatcher.set_target(target_);
241 return event; 242 return event;
242 } 243 }
243 244
244 void SendActivateStickyKeyPattern(StickyKeysHandler* handler, 245 void SendActivateStickyKeyPattern(StickyKeysHandler* handler,
245 ui::KeyboardCode key_code) { 246 ui::KeyboardCode key_code) {
246 scoped_ptr<ui::KeyEvent> ev; 247 scoped_ptr<ui::KeyEvent> ev;
247 ev.reset(GenerateKey(true, key_code)); 248 ev.reset(GenerateKey(true, key_code));
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 static_cast<ui::MouseWheelEvent*>(events[0])->y_offset()); 868 static_cast<ui::MouseWheelEvent*>(events[0])->y_offset());
868 EXPECT_TRUE(events[0]->flags() & ui::EF_CONTROL_DOWN); 869 EXPECT_TRUE(events[0]->flags() & ui::EF_CONTROL_DOWN);
869 EXPECT_EQ(ui::ET_KEY_RELEASED, events[1]->type()); 870 EXPECT_EQ(ui::ET_KEY_RELEASED, events[1]->type());
870 EXPECT_EQ(ui::VKEY_CONTROL, 871 EXPECT_EQ(ui::VKEY_CONTROL,
871 static_cast<ui::KeyEvent*>(events[1])->key_code()); 872 static_cast<ui::KeyEvent*>(events[1])->key_code());
872 873
873 Shell::GetInstance()->RemovePreTargetHandler(&buffer); 874 Shell::GetInstance()->RemovePreTargetHandler(&buffer);
874 } 875 }
875 876
876 } // namespace ash 877 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/immersive_fullscreen_controller_unittest.cc ('k') | ash/wm/user_activity_detector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698