OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/scoped_nsobject.h" | 5 #include "base/memory/scoped_nsobject.h" |
6 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 6 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
7 #include "chrome/browser/ui/cocoa/confirm_quit_panel_controller.h" | 7 #include "chrome/browser/ui/cocoa/confirm_quit_panel_controller.h" |
8 #include "testing/gtest_mac.h" | 8 #include "testing/gtest_mac.h" |
9 #include "ui/base/models/accelerator_cocoa.h" | 9 #include "ui/base/accelerators/accelerator_cocoa.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 class ConfirmQuitPanelControllerTest : public CocoaTest { | 13 class ConfirmQuitPanelControllerTest : public CocoaTest { |
14 public: | 14 public: |
15 NSString* TestString(NSString* str) { | 15 NSString* TestString(NSString* str) { |
16 str = [str stringByReplacingOccurrencesOfString:@"{Cmd}" | 16 str = [str stringByReplacingOccurrencesOfString:@"{Cmd}" |
17 withString:@"\u2318"]; | 17 withString:@"\u2318"]; |
18 str = [str stringByReplacingOccurrencesOfString:@"{Ctrl}" | 18 str = [str stringByReplacingOccurrencesOfString:@"{Ctrl}" |
19 withString:@"\u2303"]; | 19 withString:@"\u2303"]; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 item = ui::AcceleratorCocoa(@"m", NSShiftKeyMask | NSControlKeyMask); | 68 item = ui::AcceleratorCocoa(@"m", NSShiftKeyMask | NSControlKeyMask); |
69 EXPECT_NSEQ(TestString(@"{Ctrl}{Shift}M"), | 69 EXPECT_NSEQ(TestString(@"{Ctrl}{Shift}M"), |
70 [controller keyCombinationForAccelerator:item]); | 70 [controller keyCombinationForAccelerator:item]); |
71 | 71 |
72 item = ui::AcceleratorCocoa(@"e", NSCommandKeyMask | NSAlternateKeyMask); | 72 item = ui::AcceleratorCocoa(@"e", NSCommandKeyMask | NSAlternateKeyMask); |
73 EXPECT_NSEQ(TestString(@"{Cmd}{Opt}E"), | 73 EXPECT_NSEQ(TestString(@"{Cmd}{Opt}E"), |
74 [controller keyCombinationForAccelerator:item]); | 74 [controller keyCombinationForAccelerator:item]); |
75 } | 75 } |
76 | 76 |
77 } // namespace | 77 } // namespace |
OLD | NEW |