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 ee9bd7b7dcf67d1db455ee3f6b7fff7811d549bd..6d701689cefad2a317e0ab09056f0a41f5d69465 100644 |
--- a/chrome/browser/ui/cocoa/profiles/profile_menu_controller_unittest.mm |
+++ b/chrome/browser/ui/cocoa/profiles/profile_menu_controller_unittest.mm |
@@ -253,10 +253,20 @@ TEST_F(ProfileMenuControllerTest, SupervisedProfile) { |
0, |
"TEST_ID", |
TestingProfile::TestingFactories()); |
+ // The supervised profile is initially marked as omitted from the avatar menu |
+ // (in non-test code, until we have confirmation that it has actually been |
+ // created on the server). For the test, just tell the cache to un-hide it. |
+ ProfileInfoCache* cache = manager->profile_info_cache(); |
+ size_t index = |
+ cache->GetIndexOfProfileWithPath(supervised_profile->GetPath()); |
+ cache->SetIsOmittedProfileAtIndex(index, false); |
+ |
BrowserList::SetLastActive(browser()); |
NSMenu* menu = [controller() menu]; |
+ // Person 1, Supervised User, <sep>, Edit, <sep>, New. |
ASSERT_EQ(6, [menu numberOfItems]); |
+ |
NSMenuItem* item = [menu itemAtIndex:0]; |
ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]); |
EXPECT_TRUE([controller() validateMenuItem:item]); |