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

Unified Diff: chrome/browser/ui/cocoa/profiles/profile_menu_controller_unittest.mm

Issue 845373002: Change default code flag to NewAvatarMenu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test comment. GetAvatarIcon's no longer const. Created 5 years, 9 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/profiles/profile_menu_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/profiles/profile_menu_controller_unittest.mm b/chrome/browser/ui/cocoa/profiles/profile_menu_controller_unittest.mm
index e2acb1c9f4577f381cb22885cc19b0b5649256d0..5fc1e7ecb31a019171c07211891e98fff25eefbd 100644
--- a/chrome/browser/ui/cocoa/profiles/profile_menu_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/profiles/profile_menu_controller_unittest.mm
@@ -4,6 +4,7 @@
#import "chrome/browser/ui/cocoa/profiles/profile_menu_controller.h"
+#include "base/command_line.h"
#include "base/mac/scoped_nsobject.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
@@ -17,6 +18,7 @@
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/test_browser_window.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/signin/core/common/profile_management_switches.h"
#include "testing/gtest_mac.h"
#include "ui/base/l10n/l10n_util_mac.h"
@@ -80,12 +82,12 @@ class ProfileMenuControllerTest : public CocoaProfileTest {
TEST_F(ProfileMenuControllerTest, InitializeMenu) {
NSMenu* menu = [controller() menu];
- // <sep>, Edit, <sep>, New.
- ASSERT_EQ(4, [menu numberOfItems]);
+ // Profile, <sep>, Edit, <sep>, New.
+ ASSERT_EQ(5, [menu numberOfItems]);
TestBottomItems();
- EXPECT_TRUE([menu_item() isHidden]);
+ EXPECT_FALSE([menu_item() isHidden]);
}
TEST_F(ProfileMenuControllerTest, CreateItemWithTitle) {
@@ -100,9 +102,9 @@ TEST_F(ProfileMenuControllerTest, CreateItemWithTitle) {
TEST_F(ProfileMenuControllerTest, RebuildMenu) {
NSMenu* menu = [controller() menu];
- EXPECT_EQ(4, [menu numberOfItems]);
+ EXPECT_EQ(5, [menu numberOfItems]);
- EXPECT_TRUE([menu_item() isHidden]);
+ EXPECT_FALSE([menu_item() isHidden]);
// Create some more profiles on the manager.
TestingProfileManager* manager = testing_profile_manager();
@@ -130,12 +132,12 @@ TEST_F(ProfileMenuControllerTest, InsertItems) {
base::scoped_nsobject<NSMenu> menu([[NSMenu alloc] initWithTitle:@""]);
ASSERT_EQ(0, [menu numberOfItems]);
- // With only one profile, insertItems should be a no-op.
+ // Even with one profile items can still be inserted.
BOOL result = [controller() insertItemsIntoMenu:menu
atOffset:0
fromDock:NO];
- EXPECT_FALSE(result);
- EXPECT_EQ(0, [menu numberOfItems]);
+ EXPECT_TRUE(result);
+ EXPECT_EQ(1, [menu numberOfItems]);
[menu removeAllItems];
// Same for use in building the dock menu.

Powered by Google App Engine
This is Rietveld 408576698