Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller_unittest.mm

Issue 2001423002: Mac: Start removing Cocoa fullscreen code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to review. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/exclusive_access_bubble_window_controller.h" 5 #import "chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller.h"
6 6
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_window.h" 9 #include "chrome/browser/ui/browser_window.h"
10 #include "chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.h" 10 #include "chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 WebContents* web_contents = WebContents::Create( 80 WebContents* web_contents = WebContents::Create(
81 content::WebContents::CreateParams(profile(), site_instance_.get())); 81 content::WebContents::CreateParams(profile(), site_instance_.get()));
82 browser()->tab_strip_model()->AppendWebContents(web_contents, 82 browser()->tab_strip_model()->AppendWebContents(web_contents,
83 /*foreground=*/true); 83 /*foreground=*/true);
84 } 84 }
85 85
86 scoped_refptr<SiteInstance> site_instance_; 86 scoped_refptr<SiteInstance> site_instance_;
87 base::scoped_nsobject<ExclusiveAccessBubbleWindowController> controller_; 87 base::scoped_nsobject<ExclusiveAccessBubbleWindowController> controller_;
88 }; 88 };
89 89
90 // http://crbug.com/103912
91 TEST_F(ExclusiveAccessBubbleWindowControllerTest,
92 DISABLED_DenyExitsFullscreen) {
93 NSWindow* window = browser()->window()->GetNativeWindow();
94 BrowserWindowController* bwc =
95 [BrowserWindowController browserWindowControllerForWindow:window];
96
97 [bwc showWindow:nil];
98
99 AppendTabToStrip();
100 WebContents* fullscreen_tab =
101 browser()->tab_strip_model()->GetActiveWebContents();
102 {
103 base::mac::ScopedNSAutoreleasePool pool;
104 content::WindowedNotificationObserver fullscreen_observer(
105 chrome::NOTIFICATION_FULLSCREEN_CHANGED,
106 content::NotificationService::AllSources());
107 browser()->EnterFullscreenModeForTab(fullscreen_tab, GURL());
108 fullscreen_observer.Wait();
109 ASSERT_TRUE(browser()->window()->IsFullscreen());
110 }
111
112 ExclusiveAccessController* access_controller =
113 [bwc exclusiveAccessController];
114 EXPECT_TRUE(access_controller->cocoa_bubble());
115 {
116 content::WindowedNotificationObserver fullscreen_observer(
117 chrome::NOTIFICATION_FULLSCREEN_CHANGED,
118 content::NotificationService::AllSources());
119 [access_controller->cocoa_bubble() deny:nil];
120 fullscreen_observer.Wait();
121 }
122 EXPECT_FALSE(access_controller->cocoa_bubble());
123 EXPECT_FALSE(browser()->window()->IsFullscreen());
124 CloseBrowserWindow();
125 }
126
127 TEST_F(ExclusiveAccessBubbleWindowControllerTest, LabelWasReplaced) { 90 TEST_F(ExclusiveAccessBubbleWindowControllerTest, LabelWasReplaced) {
128 EXPECT_FALSE([controller_ exitLabelPlaceholder]); 91 EXPECT_FALSE([controller_ exitLabelPlaceholder]);
129 EXPECT_TRUE([controller_ exitLabel]); 92 EXPECT_TRUE([controller_ exitLabel]);
130 } 93 }
131 94
132 TEST_F(ExclusiveAccessBubbleWindowControllerTest, ShortcutText) { 95 TEST_F(ExclusiveAccessBubbleWindowControllerTest, ShortcutText) {
133 ui::PlatformAcceleratorCocoa cmd_F(@"F", NSCommandKeyMask); 96 ui::PlatformAcceleratorCocoa cmd_F(@"F", NSCommandKeyMask);
134 ui::PlatformAcceleratorCocoa cmd_shift_f(@"f", 97 ui::PlatformAcceleratorCocoa cmd_shift_f(@"f",
135 NSCommandKeyMask | NSShiftKeyMask); 98 NSCommandKeyMask | NSShiftKeyMask);
136 NSString* cmd_F_text = [ExclusiveAccessBubbleWindowController 99 NSString* cmd_F_text = [ExclusiveAccessBubbleWindowController
(...skipping 23 matching lines...) Expand all
160 profile:browser()->profile() 123 profile:browser()->profile()
161 url:GURL() 124 url:GURL()
162 bubbleType: 125 bubbleType:
163 EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_MOUSELOCK_BUTTON S]); 126 EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_MOUSELOCK_BUTTON S]);
164 [controller_ initializeLabelAndButton]; 127 [controller_ initializeLabelAndButton];
165 NSString* fullscreen_mouselock_deny_button_text = 128 NSString* fullscreen_mouselock_deny_button_text =
166 [controller_ denyButtonText]; 129 [controller_ denyButtonText];
167 EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_EXIT), 130 EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_EXIT),
168 fullscreen_mouselock_deny_button_text); 131 fullscreen_mouselock_deny_button_text);
169 } 132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698