| 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/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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 @end | 53 @end |
| 54 | 54 |
| 55 class ExclusiveAccessBubbleWindowControllerTest : public CocoaProfileTest { | 55 class ExclusiveAccessBubbleWindowControllerTest : public CocoaProfileTest { |
| 56 public: | 56 public: |
| 57 void SetUp() override { | 57 void SetUp() override { |
| 58 CocoaProfileTest::SetUp(); | 58 CocoaProfileTest::SetUp(); |
| 59 ASSERT_TRUE(profile()); | 59 ASSERT_TRUE(profile()); |
| 60 | 60 |
| 61 site_instance_ = SiteInstance::Create(profile()); | 61 site_instance_ = SiteInstance::Create(profile()); |
| 62 controller_.reset([[ExclusiveAccessBubbleWindowController alloc] | 62 controller_.reset([[ExclusiveAccessBubbleWindowController alloc] |
| 63 initWithOwner:nil | 63 initWithOwner:nil |
| 64 browser:browser() | 64 exclusive_access_manager:browser()->exclusive_access_manager() |
| 65 url:GURL() | 65 profile:browser()->profile() |
| 66 bubbleType: | 66 url:GURL() |
| 67 EXCLUSIVE_ACCESS_BUBBLE_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION]
); | 67 bubbleType: |
| 68 EXCLUSIVE_ACCESS_BUBBLE_TYPE_BROWSER_FULLSCREEN_EXIT_I
NSTRUCTION]); |
| 68 EXPECT_TRUE([controller_ window]); | 69 EXPECT_TRUE([controller_ window]); |
| 69 } | 70 } |
| 70 | 71 |
| 71 void TearDown() override { | 72 void TearDown() override { |
| 72 [controller_ close]; | 73 [controller_ close]; |
| 73 controller_.reset(); | 74 controller_.reset(); |
| 74 CocoaProfileTest::TearDown(); | 75 CocoaProfileTest::TearDown(); |
| 75 } | 76 } |
| 76 | 77 |
| 77 void AppendTabToStrip() { | 78 void AppendTabToStrip() { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 keyCombinationForAccelerator:cmd_F]; | 136 keyCombinationForAccelerator:cmd_F]; |
| 136 NSString* cmd_shift_f_text = [ExclusiveAccessBubbleWindowController | 137 NSString* cmd_shift_f_text = [ExclusiveAccessBubbleWindowController |
| 137 keyCombinationForAccelerator:cmd_shift_f]; | 138 keyCombinationForAccelerator:cmd_shift_f]; |
| 138 EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text); | 139 EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text); |
| 139 EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text); | 140 EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text); |
| 140 } | 141 } |
| 141 | 142 |
| 142 // http://crbug.com/139944 | 143 // http://crbug.com/139944 |
| 143 TEST_F(ExclusiveAccessBubbleWindowControllerTest, DenyButtonText) { | 144 TEST_F(ExclusiveAccessBubbleWindowControllerTest, DenyButtonText) { |
| 144 controller_.reset([[ExclusiveAccessBubbleWindowController alloc] | 145 controller_.reset([[ExclusiveAccessBubbleWindowController alloc] |
| 145 initWithOwner:nil | 146 initWithOwner:nil |
| 146 browser:browser() | 147 exclusive_access_manager:browser()->exclusive_access_manager() |
| 147 url:GURL() | 148 profile:browser()->profile() |
| 148 bubbleType:EXCLUSIVE_ACCESS_BUBBLE_TYPE_MOUSELOCK_BUTTONS]); | 149 url:GURL() |
| 150 bubbleType:EXCLUSIVE_ACCESS_BUBBLE_TYPE_MOUSELOCK_BUTTONS]); |
| 149 [controller_ initializeLabelAndButton]; | 151 [controller_ initializeLabelAndButton]; |
| 150 NSString* mouselock_deny_button_text = [controller_ denyButtonText]; | 152 NSString* mouselock_deny_button_text = [controller_ denyButtonText]; |
| 151 EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_DENY), | 153 EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_DENY), |
| 152 mouselock_deny_button_text); | 154 mouselock_deny_button_text); |
| 153 | 155 |
| 154 controller_.reset([[ExclusiveAccessBubbleWindowController alloc] | 156 controller_.reset([[ExclusiveAccessBubbleWindowController alloc] |
| 155 initWithOwner:nil | 157 initWithOwner:nil |
| 156 browser:browser() | 158 exclusive_access_manager:browser()->exclusive_access_manager() |
| 157 url:GURL() | 159 profile:browser()->profile() |
| 158 bubbleType:EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_MOUSELOCK_BUTTONS]); | 160 url:GURL() |
| 161 bubbleType: |
| 162 EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_MOUSELOCK_BUTTON
S]); |
| 159 [controller_ initializeLabelAndButton]; | 163 [controller_ initializeLabelAndButton]; |
| 160 NSString* fullscreen_mouselock_deny_button_text = | 164 NSString* fullscreen_mouselock_deny_button_text = |
| 161 [controller_ denyButtonText]; | 165 [controller_ denyButtonText]; |
| 162 EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_EXIT), | 166 EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_EXIT), |
| 163 fullscreen_mouselock_deny_button_text); | 167 fullscreen_mouselock_deny_button_text); |
| 164 } | 168 } |
| OLD | NEW |