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

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

Issue 1827083004: UI: Rename MediaState to AlertState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-tab-indicator
Patch Set: Keep gypi ordered Created 4 years, 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/mac/scoped_nsobject.h" 5 #include "base/mac/scoped_nsobject.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/fullscreen.h" 9 #include "chrome/browser/fullscreen.h"
10 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" 10 #include "chrome/browser/ui/bookmarks/bookmark_utils.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 TEST_F(BrowserWindowCocoaTest, TestWindowTitle) { 53 TEST_F(BrowserWindowCocoaTest, TestWindowTitle) {
54 scoped_ptr<BrowserWindowCocoa> bwc( 54 scoped_ptr<BrowserWindowCocoa> bwc(
55 new BrowserWindowCocoa(browser(), controller_)); 55 new BrowserWindowCocoa(browser(), controller_));
56 NSString* playing_emoji = @"🔊"; 56 NSString* playing_emoji = @"🔊";
57 NSString* muting_emoji = @"🔇"; 57 NSString* muting_emoji = @"🔇";
58 EXPECT_EQ(static_cast<NSUInteger>(NSNotFound), 58 EXPECT_EQ(static_cast<NSUInteger>(NSNotFound),
59 [bwc->WindowTitle() rangeOfString:playing_emoji].location); 59 [bwc->WindowTitle() rangeOfString:playing_emoji].location);
60 EXPECT_EQ(static_cast<NSUInteger>(NSNotFound), 60 EXPECT_EQ(static_cast<NSUInteger>(NSNotFound),
61 [bwc->WindowTitle() rangeOfString:muting_emoji].location); 61 [bwc->WindowTitle() rangeOfString:muting_emoji].location);
62 bwc->UpdateMediaState(TAB_MEDIA_STATE_AUDIO_PLAYING); 62 bwc->UpdateAlertState(TabAlertState::AUDIO_PLAYING);
63 EXPECT_NE(static_cast<NSUInteger>(NSNotFound), 63 EXPECT_NE(static_cast<NSUInteger>(NSNotFound),
64 [bwc->WindowTitle() rangeOfString:playing_emoji].location); 64 [bwc->WindowTitle() rangeOfString:playing_emoji].location);
65 bwc->UpdateMediaState(TAB_MEDIA_STATE_AUDIO_MUTING); 65 bwc->UpdateAlertState(TabAlertState::AUDIO_MUTING);
66 EXPECT_NE(static_cast<NSUInteger>(NSNotFound), 66 EXPECT_NE(static_cast<NSUInteger>(NSNotFound),
67 [bwc->WindowTitle() rangeOfString:muting_emoji].location); 67 [bwc->WindowTitle() rangeOfString:muting_emoji].location);
68 bwc->UpdateMediaState(TAB_MEDIA_STATE_NONE); 68 bwc->UpdateAlertState(TabAlertState::NONE);
69 EXPECT_EQ(static_cast<NSUInteger>(NSNotFound), 69 EXPECT_EQ(static_cast<NSUInteger>(NSNotFound),
70 [bwc->WindowTitle() rangeOfString:playing_emoji].location); 70 [bwc->WindowTitle() rangeOfString:playing_emoji].location);
71 EXPECT_EQ(static_cast<NSUInteger>(NSNotFound), 71 EXPECT_EQ(static_cast<NSUInteger>(NSNotFound),
72 [bwc->WindowTitle() rangeOfString:muting_emoji].location); 72 [bwc->WindowTitle() rangeOfString:muting_emoji].location);
73 } 73 }
74 74
75 // Test that IsMaximized() returns false when the browser window goes from 75 // Test that IsMaximized() returns false when the browser window goes from
76 // maximized to minimized state - http://crbug/452976. 76 // maximized to minimized state - http://crbug/452976.
77 TEST_F(BrowserWindowCocoaTest, TestMinimizeState) { 77 TEST_F(BrowserWindowCocoaTest, TestMinimizeState) {
78 scoped_ptr<BrowserWindowCocoa> bwc( 78 scoped_ptr<BrowserWindowCocoa> bwc(
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 [[[window_ stub] andReturn:nil] delegate]; 202 [[[window_ stub] andReturn:nil] delegate];
203 [[[controller_ stub] andReturn:window_] window]; 203 [[[controller_ stub] andReturn:window_] window];
204 [[window_ expect] orderOut:nil]; 204 [[window_ expect] orderOut:nil];
205 [[window_ expect] close]; 205 [[window_ expect] close];
206 CreateAndCloseBrowserWindow(); 206 CreateAndCloseBrowserWindow();
207 EXPECT_OCMOCK_VERIFY(controller_); 207 EXPECT_OCMOCK_VERIFY(controller_);
208 EXPECT_OCMOCK_VERIFY(window_); 208 EXPECT_OCMOCK_VERIFY(window_);
209 } 209 }
210 210
211 // TODO(???): test other methods of BrowserWindowCocoa 211 // TODO(???): test other methods of BrowserWindowCocoa
OLDNEW
« 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