| Index: chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm
|
| diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm
|
| index 0c7e58610e07d5a561fb4a1d387e553bc4e4c6fe..d79ea1e632e904876846459c0e780684b8888a6c 100644
|
| --- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm
|
| +++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm
|
| @@ -107,7 +107,7 @@ TEST_F(ProfileChooserControllerTest, InitialLayoutWithNewMenu) {
|
| StartProfileChooserController();
|
|
|
| NSArray* subviews = [[[controller() window] contentView] subviews];
|
| - ASSERT_EQ(2U, [subviews count]);
|
| + ASSERT_EQ(1U, [subviews count]);
|
| subviews = [[subviews objectAtIndex:0] subviews];
|
|
|
| // Three profiles means we should have one active card, one separator and
|
| @@ -146,7 +146,7 @@ TEST_F(ProfileChooserControllerTest, InitialLayoutWithNewMenu) {
|
|
|
| // Profile icon.
|
| NSView* activeProfileImage = [activeCardSubviews objectAtIndex:2];
|
| - EXPECT_TRUE([activeProfileImage isKindOfClass:[NSButton class]]);
|
| + EXPECT_TRUE([activeProfileImage isKindOfClass:[NSImageView class]]);
|
|
|
| // Profile name.
|
| NSView* activeProfileName = [activeCardSubviews objectAtIndex:1];
|
| @@ -174,7 +174,7 @@ TEST_F(ProfileChooserControllerTest, InitialLayoutWithFastUserSwitcher) {
|
| StartProfileChooserController();
|
|
|
| NSArray* subviews = [[[controller() window] contentView] subviews];
|
| - ASSERT_EQ(2U, [subviews count]);
|
| + ASSERT_EQ(1U, [subviews count]);
|
| subviews = [[subviews objectAtIndex:0] subviews];
|
|
|
| // Three profiles means we should have one active card and a
|
| @@ -217,7 +217,7 @@ TEST_F(ProfileChooserControllerTest, InitialLayoutWithFastUserSwitcher) {
|
|
|
| // Profile icon.
|
| NSView* activeProfileImage = [activeCardSubviews objectAtIndex:2];
|
| - EXPECT_TRUE([activeProfileImage isKindOfClass:[NSButton class]]);
|
| + EXPECT_TRUE([activeProfileImage isKindOfClass:[NSImageView class]]);
|
|
|
| // Profile name.
|
| NSView* activeProfileName = [activeCardSubviews objectAtIndex:1];
|
| @@ -248,7 +248,7 @@ TEST_F(ProfileChooserControllerTest, OtherProfilesSortedAlphabetically) {
|
| StartProfileChooserController();
|
|
|
| NSArray* subviews = [[[controller() window] contentView] subviews];
|
| - ASSERT_EQ(2U, [subviews count]);
|
| + ASSERT_EQ(1U, [subviews count]);
|
| subviews = [[subviews objectAtIndex:0] subviews];
|
| NSString* sortedNames[] = { @"Another Test",
|
| @"New Profile",
|
| @@ -280,7 +280,7 @@ TEST_F(ProfileChooserControllerTest,
|
| switches::EnableNewAvatarMenuForTesting(CommandLine::ForCurrentProcess());
|
| StartProfileChooserController();
|
| NSArray* subviews = [[[controller() window] contentView] subviews];
|
| - ASSERT_EQ(2U, [subviews count]);
|
| + ASSERT_EQ(1U, [subviews count]);
|
| subviews = [[subviews objectAtIndex:0] subviews];
|
| NSArray* activeCardSubviews = [[subviews objectAtIndex:2] subviews];
|
| NSArray* activeCardLinks = [[activeCardSubviews objectAtIndex:0] subviews];
|
| @@ -309,7 +309,7 @@ TEST_F(ProfileChooserControllerTest,
|
|
|
| StartProfileChooserController();
|
| NSArray* subviews = [[[controller() window] contentView] subviews];
|
| - ASSERT_EQ(2U, [subviews count]);
|
| + ASSERT_EQ(1U, [subviews count]);
|
| subviews = [[subviews objectAtIndex:0] subviews];
|
| NSArray* activeCardSubviews = [[subviews objectAtIndex:2] subviews];
|
| NSArray* activeCardLinks = [[activeCardSubviews objectAtIndex:0] subviews];
|
| @@ -331,7 +331,7 @@ TEST_F(ProfileChooserControllerTest,
|
|
|
| StartProfileChooserController();
|
| NSArray* subviews = [[[controller() window] contentView] subviews];
|
| - ASSERT_EQ(2U, [subviews count]);
|
| + ASSERT_EQ(1U, [subviews count]);
|
| subviews = [[subviews objectAtIndex:0] subviews];
|
| NSArray* activeCardSubviews = [[subviews objectAtIndex:2] subviews];
|
| NSArray* activeCardLinks = [[activeCardSubviews objectAtIndex:0] subviews];
|
| @@ -366,7 +366,7 @@ TEST_F(ProfileChooserControllerTest, AccountManagementLayout) {
|
| profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT];
|
|
|
| NSArray* subviews = [[[controller() window] contentView] subviews];
|
| - ASSERT_EQ(2U, [subviews count]);
|
| + ASSERT_EQ(1U, [subviews count]);
|
| subviews = [[subviews objectAtIndex:0] subviews];
|
|
|
| // There should be one active card, one accounts container, two separators
|
| @@ -443,7 +443,7 @@ TEST_F(ProfileChooserControllerTest, AccountManagementLayout) {
|
|
|
| // Profile icon.
|
| NSView* activeProfileImage = [activeCardSubviews objectAtIndex:2];
|
| - EXPECT_TRUE([activeProfileImage isKindOfClass:[NSButton class]]);
|
| + EXPECT_TRUE([activeProfileImage isKindOfClass:[NSImageView class]]);
|
|
|
| // Profile name.
|
| NSView* activeProfileName = [activeCardSubviews objectAtIndex:1];
|
| @@ -459,69 +459,3 @@ TEST_F(ProfileChooserControllerTest, AccountManagementLayout) {
|
| EXPECT_EQ(@selector(hideAccountManagement:), [link action]);
|
| EXPECT_EQ(controller(), [link target]);
|
| }
|
| -
|
| -TEST_F(ProfileChooserControllerTest, SignedInProfileLockDisabled) {
|
| - switches::EnableNewProfileManagementForTesting(
|
| - CommandLine::ForCurrentProcess());
|
| - // Sign in the first profile.
|
| - ProfileInfoCache* cache = testing_profile_manager()->profile_info_cache();
|
| - cache->SetUserNameOfProfileAtIndex(0, base::ASCIIToUTF16(kEmail));
|
| - cache->SetLocalAuthCredentialsOfProfileAtIndex(0, std::string());
|
| -
|
| - StartProfileChooserController();
|
| - NSArray* subviews = [[[controller() window] contentView] subviews];
|
| - ASSERT_EQ(2U, [subviews count]);
|
| - subviews = [[subviews objectAtIndex:0] subviews];
|
| -
|
| - // Three profiles means we should have one active card, one separator, one
|
| - // option buttons view and a lock view. We also have an update promo for the
|
| - // new avatar menu.
|
| - // TODO(noms): Enforcing 5U fails on the waterfall debug bots, but it's not
|
| - // reproducible anywhere else.
|
| - ASSERT_GE([subviews count], 4U);
|
| -
|
| - // There will be three buttons and two separators in the option buttons view.
|
| - NSArray* buttonSubviews = [[subviews objectAtIndex:0] subviews];
|
| - ASSERT_EQ(5U, [buttonSubviews count]);
|
| -
|
| - // There should be a lock button.
|
| - NSButton* lockButton =
|
| - base::mac::ObjCCast<NSButton>([buttonSubviews objectAtIndex:0]);
|
| - ASSERT_TRUE(lockButton);
|
| - EXPECT_EQ(@selector(lockProfile:), [lockButton action]);
|
| - EXPECT_EQ(controller(), [lockButton target]);
|
| - EXPECT_FALSE([lockButton isEnabled]);
|
| -}
|
| -
|
| -TEST_F(ProfileChooserControllerTest, SignedInProfileLockEnabled) {
|
| - switches::EnableNewProfileManagementForTesting(
|
| - CommandLine::ForCurrentProcess());
|
| - // Sign in the first profile.
|
| - ProfileInfoCache* cache = testing_profile_manager()->profile_info_cache();
|
| - cache->SetUserNameOfProfileAtIndex(0, base::ASCIIToUTF16(kEmail));
|
| - cache->SetLocalAuthCredentialsOfProfileAtIndex(0, "YourHashHere");
|
| -
|
| - StartProfileChooserController();
|
| - NSArray* subviews = [[[controller() window] contentView] subviews];
|
| - ASSERT_EQ(2U, [subviews count]);
|
| - subviews = [[subviews objectAtIndex:0] subviews];
|
| -
|
| - // Three profiles means we should have one active card, one separator, one
|
| - // option buttons view and a lock view. We also have an update promo for the
|
| - // new avatar menu.
|
| - // TODO(noms): Enforcing 5U fails on the waterfall debug bots, but it's not
|
| - // reproducible anywhere else.
|
| - ASSERT_GE([subviews count], 4U);
|
| -
|
| - // There will be three buttons and two separators in the option buttons view.
|
| - NSArray* buttonSubviews = [[subviews objectAtIndex:0] subviews];
|
| - ASSERT_EQ(5U, [buttonSubviews count]);
|
| -
|
| - // There should be a lock button.
|
| - NSButton* lockButton =
|
| - base::mac::ObjCCast<NSButton>([buttonSubviews objectAtIndex:0]);
|
| - ASSERT_TRUE(lockButton);
|
| - EXPECT_EQ(@selector(lockProfile:), [lockButton action]);
|
| - EXPECT_EQ(controller(), [lockButton target]);
|
| - EXPECT_TRUE([lockButton isEnabled]);
|
| -}
|
|
|