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

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

Issue 117533002: [Mac] Redesign of the avatar menu button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nico review Created 6 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/browser/avatar_icon_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm b/chrome/browser/ui/cocoa/browser/avatar_icon_controller_unittest.mm
similarity index 83%
copy from chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm
copy to chrome/browser/ui/cocoa/browser/avatar_icon_controller_unittest.mm
index 99a3b5705c05ecb1ea5598da9ac3cf7184489316..29b5c7864dc4729d039d252e98165bd38d4915c2 100644
--- a/chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/browser/avatar_icon_controller_unittest.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h"
+#import "chrome/browser/ui/cocoa/browser/avatar_icon_controller.h"
#include "base/mac/scoped_nsobject.h"
#include "base/strings/utf_string_conversions.h"
@@ -16,20 +16,21 @@
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_window.h"
#import "chrome/browser/ui/cocoa/base_bubble_controller.h"
+#import "chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h"
#include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
#include "chrome/browser/ui/cocoa/info_bubble_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
-class AvatarButtonControllerTest : public CocoaProfileTest {
+class AvatarIconControllerTest : public CocoaProfileTest {
public:
virtual void SetUp() OVERRIDE {
CocoaProfileTest::SetUp();
ASSERT_TRUE(browser());
controller_.reset(
- [[AvatarButtonController alloc] initWithBrowser:browser()]);
+ [[AvatarIconController alloc] initWithBrowser:browser()]);
[[controller_ view] setHidden:YES];
}
@@ -42,13 +43,13 @@ class AvatarButtonControllerTest : public CocoaProfileTest {
NSView* view() { return [controller_ view]; }
- AvatarButtonController* controller() { return controller_.get(); }
+ AvatarIconController* controller() { return controller_.get(); }
private:
- base::scoped_nsobject<AvatarButtonController> controller_;
+ base::scoped_nsobject<AvatarIconController> controller_;
};
-TEST_F(AvatarButtonControllerTest, AddRemoveProfiles) {
+TEST_F(AvatarIconControllerTest, AddRemoveProfiles) {
EXPECT_TRUE([view() isHidden]);
testing_profile_manager()->CreateTestingProfile("one");
@@ -65,7 +66,7 @@ TEST_F(AvatarButtonControllerTest, AddRemoveProfiles) {
EXPECT_TRUE([view() isHidden]);
}
-TEST_F(AvatarButtonControllerTest, DoubleOpen) {
+TEST_F(AvatarIconControllerTest, DoubleOpen) {
// Create a second profile to enable the avatar menu.
testing_profile_manager()->CreateTestingProfile("p2");
@@ -74,6 +75,8 @@ TEST_F(AvatarButtonControllerTest, DoubleOpen) {
[button() performClick:button()];
BaseBubbleController* menu = [controller() menuController];
+ EXPECT_TRUE([menu isKindOfClass:[AvatarMenuBubbleController class]]);
+
EXPECT_TRUE(menu);
[button() performClick:button()];
@@ -88,7 +91,7 @@ TEST_F(AvatarButtonControllerTest, DoubleOpen) {
testing_profile_manager()->DeleteTestingProfile("p2");
}
-TEST_F(AvatarButtonControllerTest, ManagedUserLabel) {
+TEST_F(AvatarIconControllerTest, ManagedUserLabel) {
DCHECK(!profile()->IsManaged());
EXPECT_FALSE([controller() labelButtonView]);
@@ -111,8 +114,8 @@ TEST_F(AvatarButtonControllerTest, ManagedUserLabel) {
new Browser(Browser::CreateParams(profile, chrome::GetActiveDesktop()));
// Build a new controller to check if it is initialized correctly for a
// managed user profile.
- base::scoped_nsobject<AvatarButtonController> controller(
- [[AvatarButtonController alloc] initWithBrowser:browser]);
+ base::scoped_nsobject<AvatarIconController> controller(
+ [[AvatarIconController alloc] initWithBrowser:browser]);
EXPECT_TRUE([controller labelButtonView]);
« no previous file with comments | « chrome/browser/ui/cocoa/browser/avatar_icon_controller.mm ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698