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

Side by Side Diff: chrome/browser/chromeos/events/event_rewriter_unittest.cc

Issue 308023002: Add EF_IS_REPEAT flag to KeyEvent to handle repeated accelerators correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use ui::EF_IS_REPEAT in test instead Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/accelerators/nested_accelerator_delegate.cc ('k') | ui/base/accelerators/accelerator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/chromeos/events/event_rewriter.h" 5 #include "chrome/browser/chromeos/events/event_rewriter.h"
6 6
7 #include <X11/keysym.h> 7 #include <X11/keysym.h>
8 #include <X11/XF86keysym.h> 8 #include <X11/XF86keysym.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #undef Bool 10 #undef Bool
(...skipping 25 matching lines...) Expand all
36 #include "ui/events/x/touch_factory_x11.h" 36 #include "ui/events/x/touch_factory_x11.h"
37 #include "ui/gfx/x/x11_types.h" 37 #include "ui/gfx/x/x11_types.h"
38 38
39 namespace { 39 namespace {
40 40
41 std::string GetExpectedResultAsString(ui::KeyboardCode ui_keycode, 41 std::string GetExpectedResultAsString(ui::KeyboardCode ui_keycode,
42 int ui_flags, 42 int ui_flags,
43 ui::EventType ui_type) { 43 ui::EventType ui_type) {
44 return base::StringPrintf("ui_keycode=0x%X ui_flags=0x%X ui_type=%d", 44 return base::StringPrintf("ui_keycode=0x%X ui_flags=0x%X ui_type=%d",
45 ui_keycode, 45 ui_keycode,
46 ui_flags, 46 ui_flags & ~ui::EF_IS_REPEAT,
47 ui_type); 47 ui_type);
48 } 48 }
49 49
50 std::string GetKeyEventAsString(const ui::KeyEvent& keyevent) { 50 std::string GetKeyEventAsString(const ui::KeyEvent& keyevent) {
51 return GetExpectedResultAsString( 51 return GetExpectedResultAsString(
52 keyevent.key_code(), keyevent.flags(), keyevent.type()); 52 keyevent.key_code(), keyevent.flags(), keyevent.type());
53 } 53 }
54 54
55 std::string GetRewrittenEventAsString(chromeos::EventRewriter* rewriter, 55 std::string GetRewrittenEventAsString(chromeos::EventRewriter* rewriter,
56 ui::KeyboardCode ui_keycode, 56 ui::KeyboardCode ui_keycode,
(...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 ui::ScopedXI2Event xev; 1666 ui::ScopedXI2Event xev;
1667 xev.InitGenericButtonEvent( 1667 xev.InitGenericButtonEvent(
1668 11, ui::ET_MOUSE_RELEASED, gfx::Point(), kLeftAndAltFlag); 1668 11, ui::ET_MOUSE_RELEASED, gfx::Point(), kLeftAndAltFlag);
1669 ui::MouseEvent release(xev); 1669 ui::MouseEvent release(xev);
1670 int flags = RewriteMouseEvent(&rewriter, release); 1670 int flags = RewriteMouseEvent(&rewriter, release);
1671 EXPECT_TRUE(ui::EF_RIGHT_MOUSE_BUTTON & flags); 1671 EXPECT_TRUE(ui::EF_RIGHT_MOUSE_BUTTON & flags);
1672 } 1672 }
1673 } 1673 }
1674 1674
1675 } // namespace chromeos 1675 } // namespace chromeos
OLDNEW
« no previous file with comments | « ash/accelerators/nested_accelerator_delegate.cc ('k') | ui/base/accelerators/accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698