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

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

Issue 1078713002: Supervised users: Re-check ManagementPolicy when ProfileIsSupervised changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: shaving the yak Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_service.cc ('k') | chrome/test/base/testing_profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]);
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_service.cc ('k') | chrome/test/base/testing_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698