OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 profile(), site_instance_, MSG_ROUTING_NONE, NULL, NULL); | 70 profile(), site_instance_, MSG_ROUTING_NONE, NULL, NULL); |
71 browser()->tab_strip_model()->AppendTabContents( | 71 browser()->tab_strip_model()->AppendTabContents( |
72 tab_contents, /*foreground=*/true); | 72 tab_contents, /*foreground=*/true); |
73 } | 73 } |
74 | 74 |
75 scoped_refptr<SiteInstance> site_instance_; | 75 scoped_refptr<SiteInstance> site_instance_; |
76 scoped_nsobject<FullscreenExitBubbleController> controller_; | 76 scoped_nsobject<FullscreenExitBubbleController> controller_; |
77 }; | 77 }; |
78 | 78 |
79 TEST_F(FullscreenExitBubbleControllerTest, DenyExitsFullscreen) { | 79 TEST_F(FullscreenExitBubbleControllerTest, DenyExitsFullscreen) { |
80 CreateBrowserWindow(); | |
81 NSWindow* window = browser()->window()->GetNativeWindow(); | 80 NSWindow* window = browser()->window()->GetNativeWindow(); |
82 BrowserWindowController* bwc = [BrowserWindowController | 81 BrowserWindowController* bwc = [BrowserWindowController |
83 browserWindowControllerForWindow:window]; | 82 browserWindowControllerForWindow:window]; |
84 | 83 |
85 [bwc showWindow:nil]; | 84 [bwc showWindow:nil]; |
86 | 85 |
87 AppendTabToStrip(); | 86 AppendTabToStrip(); |
88 WebContents* fullscreen_tab = chrome::GetActiveWebContents(browser()); | 87 WebContents* fullscreen_tab = chrome::GetActiveWebContents(browser()); |
89 { | 88 { |
90 base::mac::ScopedNSAutoreleasePool pool; | 89 base::mac::ScopedNSAutoreleasePool pool; |
(...skipping 27 matching lines...) Expand all Loading... |
118 TEST_F(FullscreenExitBubbleControllerTest, ShortcutText) { | 117 TEST_F(FullscreenExitBubbleControllerTest, ShortcutText) { |
119 ui::AcceleratorCocoa cmd_F(@"F", NSCommandKeyMask); | 118 ui::AcceleratorCocoa cmd_F(@"F", NSCommandKeyMask); |
120 ui::AcceleratorCocoa cmd_shift_f(@"f", NSCommandKeyMask|NSShiftKeyMask); | 119 ui::AcceleratorCocoa cmd_shift_f(@"f", NSCommandKeyMask|NSShiftKeyMask); |
121 NSString* cmd_F_text = [FullscreenExitBubbleController | 120 NSString* cmd_F_text = [FullscreenExitBubbleController |
122 keyCombinationForAccelerator:cmd_F]; | 121 keyCombinationForAccelerator:cmd_F]; |
123 NSString* cmd_shift_f_text = [FullscreenExitBubbleController | 122 NSString* cmd_shift_f_text = [FullscreenExitBubbleController |
124 keyCombinationForAccelerator:cmd_shift_f]; | 123 keyCombinationForAccelerator:cmd_shift_f]; |
125 EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text); | 124 EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text); |
126 EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text); | 125 EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text); |
127 } | 126 } |
OLD | NEW |