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 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h" |
6 | 6 |
7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 #include "chrome/browser/tabs/tab_strip_model.h" |
8 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
10 #include "chrome/browser/ui/cocoa/browser_window_controller.h" | 11 #include "chrome/browser/ui/cocoa/browser_window_controller.h" |
11 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 12 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
12 #include "chrome/browser/tabs/tab_strip_model.h" | |
13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
14 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
15 #include "content/browser/site_instance.h" | 15 #include "content/browser/site_instance.h" |
16 #include "testing/gtest_mac.h" | 16 #include "testing/gtest_mac.h" |
17 #include "ui/base/models/accelerator_cocoa.h" | 17 #include "ui/base/accelerators/accelerator_cocoa.h" |
18 | 18 |
19 @interface FullscreenExitBubbleController(JustForTesting) | 19 @interface FullscreenExitBubbleController(JustForTesting) |
20 // Already defined. | 20 // Already defined. |
21 + (NSString*)keyCommandString; | 21 + (NSString*)keyCommandString; |
22 + (NSString*)keyCombinationForAccelerator:(const ui::AcceleratorCocoa&)item; | 22 + (NSString*)keyCombinationForAccelerator:(const ui::AcceleratorCocoa&)item; |
23 @end | 23 @end |
24 | 24 |
25 @interface FullscreenExitBubbleController(ExposedForTesting) | 25 @interface FullscreenExitBubbleController(ExposedForTesting) |
26 - (NSTextField*)exitLabelPlaceholder; | 26 - (NSTextField*)exitLabelPlaceholder; |
27 - (NSTextView*)exitLabel; | 27 - (NSTextView*)exitLabel; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 TEST_F(FullscreenExitBubbleControllerTest, ShortcutText) { | 112 TEST_F(FullscreenExitBubbleControllerTest, ShortcutText) { |
113 ui::AcceleratorCocoa cmd_F(@"F", NSCommandKeyMask); | 113 ui::AcceleratorCocoa cmd_F(@"F", NSCommandKeyMask); |
114 ui::AcceleratorCocoa cmd_shift_f(@"f", NSCommandKeyMask|NSShiftKeyMask); | 114 ui::AcceleratorCocoa cmd_shift_f(@"f", NSCommandKeyMask|NSShiftKeyMask); |
115 NSString* cmd_F_text = [FullscreenExitBubbleController | 115 NSString* cmd_F_text = [FullscreenExitBubbleController |
116 keyCombinationForAccelerator:cmd_F]; | 116 keyCombinationForAccelerator:cmd_F]; |
117 NSString* cmd_shift_f_text = [FullscreenExitBubbleController | 117 NSString* cmd_shift_f_text = [FullscreenExitBubbleController |
118 keyCombinationForAccelerator:cmd_shift_f]; | 118 keyCombinationForAccelerator:cmd_shift_f]; |
119 EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text); | 119 EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text); |
120 EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text); | 120 EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text); |
121 } | 121 } |
OLD | NEW |