OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import "chrome/browser/cocoa/nsmenuitem_additions.h" | 5 #import "chrome/browser/cocoa/nsmenuitem_additions.h" |
6 | 6 |
7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
8 | 8 |
9 #include <iostream> | 9 #include <ostream> |
10 | 10 |
11 #include "base/scoped_nsobject.h" | 11 #include "base/scoped_nsobject.h" |
12 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 NSEvent* KeyEvent(const NSUInteger modifierFlags, | 15 NSEvent* KeyEvent(const NSUInteger modifierFlags, |
16 NSString* chars, | 16 NSString* chars, |
17 NSString* charsNoMods, | 17 NSString* charsNoMods, |
18 const NSUInteger keyCode) { | 18 const NSUInteger keyCode) { |
19 return [NSEvent keyEventWithType:NSKeyDown | 19 return [NSEvent keyEventWithType:NSKeyDown |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 } | 342 } |
343 | 343 |
344 EventModifiers modifiers = cmdKey >> 8; | 344 EventModifiers modifiers = cmdKey >> 8; |
345 NSString* chars = keyCodeToCharacter(keyCode, modifiers, ref); | 345 NSString* chars = keyCodeToCharacter(keyCode, modifiers, ref); |
346 NSString* charsIgnoringMods = keyCodeToCharacter(keyCode, 0, ref); | 346 NSString* charsIgnoringMods = keyCodeToCharacter(keyCode, 0, ref); |
347 NSEvent* key = KeyEvent(0x100000, chars, charsIgnoringMods, keyCode); | 347 NSEvent* key = KeyEvent(0x100000, chars, charsIgnoringMods, keyCode); |
348 ExpectKeyFiresItem(key, item, false); | 348 ExpectKeyFiresItem(key, item, false); |
349 } | 349 } |
350 CFRelease(list); | 350 CFRelease(list); |
351 } | 351 } |
OLD | NEW |