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

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

Issue 1432803002: Removed emojis from generated_resources.grd and update the code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Prevent leaking strings in the unit test Created 5 years, 1 month 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/browser_window_cocoa_unittest.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm b/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
index 3ff2a87e7ab82e045b73aa449793fb8b8415642f..a55de3d3f7051ab0780d9a2f54841909e75dd5ca 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
@@ -11,11 +11,13 @@
#import "chrome/browser/ui/cocoa/browser_window_cocoa.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
+#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/notification_details.h"
#include "testing/gtest/include/gtest/gtest.h"
#import "third_party/ocmock/OCMock/OCMock.h"
#import "third_party/ocmock/gtest_support.h"
+#include "ui/base/l10n/l10n_util_mac.h"
// Main test class.
class BrowserWindowCocoaTest : public CocoaProfileTest {
@@ -48,6 +50,28 @@ TEST_F(BrowserWindowCocoaTest, TestBookmarkBarVisible) {
EXPECT_EQ(before, bwc->IsBookmarkBarVisible());
}
+TEST_F(BrowserWindowCocoaTest, TestWindowTitle) {
+ scoped_ptr<BrowserWindowCocoa> bwc(
+ new BrowserWindowCocoa(browser(), controller_));
+ NSString* playing_emoji = @"🔊";
+ NSString* muting_emoji = @"🔇";
+ EXPECT_EQ(static_cast<NSUInteger>(NSNotFound),
+ [bwc->WindowTitle() rangeOfString:playing_emoji].location);
+ EXPECT_EQ(static_cast<NSUInteger>(NSNotFound),
+ [bwc->WindowTitle() rangeOfString:muting_emoji].location);
+ bwc->UpdateMediaState(TAB_MEDIA_STATE_AUDIO_PLAYING);
+ EXPECT_NE(static_cast<NSUInteger>(NSNotFound),
+ [bwc->WindowTitle() rangeOfString:playing_emoji].location);
+ bwc->UpdateMediaState(TAB_MEDIA_STATE_AUDIO_MUTING);
+ EXPECT_NE(static_cast<NSUInteger>(NSNotFound),
+ [bwc->WindowTitle() rangeOfString:muting_emoji].location);
+ bwc->UpdateMediaState(TAB_MEDIA_STATE_NONE);
+ EXPECT_EQ(static_cast<NSUInteger>(NSNotFound),
+ [bwc->WindowTitle() rangeOfString:playing_emoji].location);
+ EXPECT_EQ(static_cast<NSUInteger>(NSNotFound),
+ [bwc->WindowTitle() rangeOfString:muting_emoji].location);
+}
+
// Test that IsMaximized() returns false when the browser window goes from
// maximized to minimized state - http://crbug/452976.
TEST_F(BrowserWindowCocoaTest, TestMinimizeState) {
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.mm ('k') | chrome/browser/ui/cocoa/browser_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698