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 "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
9 #include "chrome/browser/ui/cocoa/browser_window_controller.h" | 10 #include "chrome/browser/ui/cocoa/browser_window_controller.h" |
10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 11 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
11 #include "chrome/browser/tabs/tab_strip_model.h" | 12 #include "chrome/browser/tabs/tab_strip_model.h" |
12 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
13 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
14 #include "content/browser/site_instance.h" | 15 #include "content/browser/site_instance.h" |
15 #include "testing/gtest_mac.h" | 16 #include "testing/gtest_mac.h" |
16 #include "ui/base/models/accelerator_cocoa.h" | 17 #include "ui/base/models/accelerator_cocoa.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 NULL, NULL); | 64 NULL, NULL); |
64 browser()->tabstrip_model()->AppendTabContents( | 65 browser()->tabstrip_model()->AppendTabContents( |
65 tab_contents, /*foreground=*/true); | 66 tab_contents, /*foreground=*/true); |
66 } | 67 } |
67 | 68 |
68 scoped_refptr<SiteInstance> site_instance_; | 69 scoped_refptr<SiteInstance> site_instance_; |
69 scoped_nsobject<FullscreenExitBubbleController> controller_; | 70 scoped_nsobject<FullscreenExitBubbleController> controller_; |
70 }; | 71 }; |
71 | 72 |
72 TEST_F(FullscreenExitBubbleControllerTest, DenyExitsFullscreen) { | 73 TEST_F(FullscreenExitBubbleControllerTest, DenyExitsFullscreen) { |
| 74 if (base::mac::IsOSLionOrLater()) |
| 75 FAIL() << "This test crashes on Lion; http://crbug.com/103906"; |
| 76 |
73 CreateBrowserWindow(); | 77 CreateBrowserWindow(); |
74 AppendTabToStrip(); | 78 AppendTabToStrip(); |
75 TabContents* fullscreen_tab = browser()->GetSelectedTabContents(); | 79 TabContents* fullscreen_tab = browser()->GetSelectedTabContents(); |
76 { | 80 { |
77 base::mac::ScopedNSAutoreleasePool pool; | 81 base::mac::ScopedNSAutoreleasePool pool; |
78 ui_test_utils::WindowedNotificationObserver fullscreen_observer( | 82 ui_test_utils::WindowedNotificationObserver fullscreen_observer( |
79 chrome::NOTIFICATION_FULLSCREEN_CHANGED, | 83 chrome::NOTIFICATION_FULLSCREEN_CHANGED, |
80 content::NotificationService::AllSources()); | 84 content::NotificationService::AllSources()); |
81 browser()->ToggleFullscreenModeForTab(fullscreen_tab, true); | 85 browser()->ToggleFullscreenModeForTab(fullscreen_tab, true); |
82 fullscreen_observer.Wait(); | 86 fullscreen_observer.Wait(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 TEST_F(FullscreenExitBubbleControllerTest, ShortcutText) { | 122 TEST_F(FullscreenExitBubbleControllerTest, ShortcutText) { |
119 ui::AcceleratorCocoa cmd_F(@"F", NSCommandKeyMask); | 123 ui::AcceleratorCocoa cmd_F(@"F", NSCommandKeyMask); |
120 ui::AcceleratorCocoa cmd_shift_f(@"f", NSCommandKeyMask|NSShiftKeyMask); | 124 ui::AcceleratorCocoa cmd_shift_f(@"f", NSCommandKeyMask|NSShiftKeyMask); |
121 NSString* cmd_F_text = [FullscreenExitBubbleController | 125 NSString* cmd_F_text = [FullscreenExitBubbleController |
122 keyCombinationForAccelerator:cmd_F]; | 126 keyCombinationForAccelerator:cmd_F]; |
123 NSString* cmd_shift_f_text = [FullscreenExitBubbleController | 127 NSString* cmd_shift_f_text = [FullscreenExitBubbleController |
124 keyCombinationForAccelerator:cmd_shift_f]; | 128 keyCombinationForAccelerator:cmd_shift_f]; |
125 EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text); | 129 EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text); |
126 EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text); | 130 EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text); |
127 } | 131 } |
OLD | NEW |