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

Unified Diff: chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller_unittest.mm

Issue 856253002: Bug fix for the pointer lock string problem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller_unittest.mm b/chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller_unittest.mm
index 1d062ef73ae4337ec945f2cd58446ee0bb2fbfb6..013407a4034c70d29babe52f1d19cc2ed2ce74f9 100644
--- a/chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller_unittest.mm
@@ -10,6 +10,7 @@
#include "chrome/browser/ui/cocoa/browser_window_controller.h"
#include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/site_instance.h"
@@ -17,6 +18,8 @@
#include "content/public/test/test_utils.h"
#include "testing/gtest_mac.h"
#include "ui/base/accelerators/platform_accelerator_cocoa.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/l10n/l10n_util_mac.h"
using content::SiteInstance;
using content::WebContents;
@@ -26,11 +29,13 @@ using content::WebContents;
+ (NSString*)keyCommandString;
+ (NSString*)keyCombinationForAccelerator:
(const ui::PlatformAcceleratorCocoa&)item;
+- (void)initializeLabel;
@end
@interface ExclusiveAccessBubbleWindowController (ExposedForTesting)
- (NSTextField*)exitLabelPlaceholder;
- (NSTextView*)exitLabel;
+- (NSString*)denyButtonText;
@end
@implementation ExclusiveAccessBubbleWindowController (ExposedForTesting)
@@ -41,6 +46,10 @@ using content::WebContents;
- (NSTextView*)exitLabel {
return exitLabel_;
}
+
+- (NSString*)denyButtonText {
+ return [denyButton_ title];
+}
@end
class ExclusiveAccessBubbleWindowControllerTest : public CocoaProfileTest {
@@ -129,3 +138,27 @@ TEST_F(ExclusiveAccessBubbleWindowControllerTest, ShortcutText) {
EXPECT_NSEQ(cmd_shift_f_text, cmd_F_text);
EXPECT_NSEQ(@"\u2318\u21E7F", cmd_shift_f_text);
}
+
+// http://crbug.com/139944
+TEST_F(ExclusiveAccessBubbleWindowControllerTest, DenyButtonText) {
+ controller_.reset([[ExclusiveAccessBubbleWindowController alloc]
+ initWithOwner:nil
+ browser:browser()
+ url:GURL()
+ bubbleType:EXCLUSIVE_ACCESS_BUBBLE_TYPE_MOUSELOCK_BUTTONS]);
+ [controller_ initializeLabel];
+ NSString* mouselock_deny_button_text = [controller_ denyButtonText];
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_DENY),
+ mouselock_deny_button_text);
+
+ controller_.reset([[ExclusiveAccessBubbleWindowController alloc]
+ initWithOwner:nil
+ browser:browser()
+ url:GURL()
+ bubbleType:EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_MOUSELOCK_BUTTONS]);
+ [controller_ initializeLabel];
+ NSString* fullscreen_mouselock_deny_button_text =
+ [controller_ denyButtonText];
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_FULLSCREEN_EXIT),
+ fullscreen_mouselock_deny_button_text);
+}

Powered by Google App Engine
This is Rietveld 408576698