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

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

Issue 877413004: Refactor away the Browser* dependency in exclusive_access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix broken mac change Created 5 years, 9 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_window_controller.h" 10 #include "chrome/browser/ui/cocoa/browser_window_controller.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 @end 54 @end
55 55
56 class ExclusiveAccessBubbleWindowControllerTest : public CocoaProfileTest { 56 class ExclusiveAccessBubbleWindowControllerTest : public CocoaProfileTest {
57 public: 57 public:
58 void SetUp() override { 58 void SetUp() override {
59 CocoaProfileTest::SetUp(); 59 CocoaProfileTest::SetUp();
60 ASSERT_TRUE(profile()); 60 ASSERT_TRUE(profile());
61 61
62 site_instance_ = SiteInstance::Create(profile()); 62 site_instance_ = SiteInstance::Create(profile());
63 controller_.reset([[ExclusiveAccessBubbleWindowController alloc] 63 controller_.reset([[ExclusiveAccessBubbleWindowController alloc]
64 initWithOwner:nil 64 initWithOwner:nil
65 browser:browser() 65 exclusive_access_manager:browser()->exclusive_access_manager()
66 url:GURL() 66 profile:browser()->profile()
67 bubbleType: 67 url:GURL()
68 EXCLUSIVE_ACCESS_BUBBLE_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION] ); 68 bubbleType:
69 EXCLUSIVE_ACCESS_BUBBLE_TYPE_BROWSER_FULLSCREEN_EXIT_I NSTRUCTION]);
69 EXPECT_TRUE([controller_ window]); 70 EXPECT_TRUE([controller_ window]);
70 } 71 }
71 72
72 void TearDown() override { 73 void TearDown() override {
73 [controller_ close]; 74 [controller_ close];
74 controller_.reset(); 75 controller_.reset();
75 CocoaProfileTest::TearDown(); 76 CocoaProfileTest::TearDown();
76 } 77 }
77 78
78 void AppendTabToStrip() { 79 void AppendTabToStrip() {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 keyCombinationForAccelerator:cmd_F]; 137 keyCombinationForAccelerator:cmd_F];
137 NSString* cmd_shift_f_text = [ExclusiveAccessBubbleWindowController 138 NSString* cmd_shift_f_text = [ExclusiveAccessBubbleWindowController
138 keyCombinationForAccelerator:cmd_shift_f]; 139 keyCombinationForAccelerator:cmd_shift_f];
139 EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text); 140 EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text);
140 EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text); 141 EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text);
141 } 142 }
142 143
143 // http://crbug.com/139944 144 // http://crbug.com/139944
144 TEST_F(ExclusiveAccessBubbleWindowControllerTest, DenyButtonText) { 145 TEST_F(ExclusiveAccessBubbleWindowControllerTest, DenyButtonText) {
145 controller_.reset([[ExclusiveAccessBubbleWindowController alloc] 146 controller_.reset([[ExclusiveAccessBubbleWindowController alloc]
146 initWithOwner:nil 147 initWithOwner:nil
147 browser:browser() 148 exclusive_access_manager:browser()->exclusive_access_manager()
148 url:GURL() 149 profile:browser()->profile()
149 bubbleType:EXCLUSIVE_ACCESS_BUBBLE_TYPE_MOUSELOCK_BUTTONS]); 150 url:GURL()
151 bubbleType:EXCLUSIVE_ACCESS_BUBBLE_TYPE_MOUSELOCK_BUTTONS]);
150 [controller_ initializeLabelAndButton]; 152 [controller_ initializeLabelAndButton];
151 NSString* mouselock_deny_button_text = [controller_ denyButtonText]; 153 NSString* mouselock_deny_button_text = [controller_ denyButtonText];
152 EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_DENY), 154 EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_DENY),
153 mouselock_deny_button_text); 155 mouselock_deny_button_text);
154 156
155 controller_.reset([[ExclusiveAccessBubbleWindowController alloc] 157 controller_.reset([[ExclusiveAccessBubbleWindowController alloc]
156 initWithOwner:nil 158 initWithOwner:nil
157 browser:browser() 159 exclusive_access_manager:browser()->exclusive_access_manager()
158 url:GURL() 160 profile:browser()->profile()
159 bubbleType:EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_MOUSELOCK_BUTTONS]); 161 url:GURL()
162 bubbleType:
163 EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_MOUSELOCK_BUTTON S]);
160 [controller_ initializeLabelAndButton]; 164 [controller_ initializeLabelAndButton];
161 NSString* fullscreen_mouselock_deny_button_text = 165 NSString* fullscreen_mouselock_deny_button_text =
162 [controller_ denyButtonText]; 166 [controller_ denyButtonText];
163 EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_EXIT), 167 EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_EXIT),
164 fullscreen_mouselock_deny_button_text); 168 fullscreen_mouselock_deny_button_text);
165 } 169 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698