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

Side by Side Diff: chrome/browser/ui/cocoa/profile_menu_controller_unittest.mm

Issue 59883010: This is the fourth CL of several that will eventually replace TokenService with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change LOG(INFO) to VLOG(1) Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/profile_menu_controller.h" 5 #import "chrome/browser/ui/cocoa/profile_menu_controller.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/threading/thread_restrictions.h" 9 #include "base/threading/thread_restrictions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 base::ThreadRestrictions::SetIOAllowed(io_was_allowed); 244 base::ThreadRestrictions::SetIOAllowed(io_was_allowed);
245 } 245 }
246 246
247 TEST_F(ProfileMenuControllerTest, ManagedProfile) { 247 TEST_F(ProfileMenuControllerTest, ManagedProfile) {
248 TestingProfileManager* manager = testing_profile_manager(); 248 TestingProfileManager* manager = testing_profile_manager();
249 TestingProfile* managed_profile = 249 TestingProfile* managed_profile =
250 manager->CreateTestingProfile("test1", 250 manager->CreateTestingProfile("test1",
251 scoped_ptr<PrefServiceSyncable>(), 251 scoped_ptr<PrefServiceSyncable>(),
252 ASCIIToUTF16("Supervised User"), 252 ASCIIToUTF16("Supervised User"),
253 0, 253 0,
254 "TEST_ID"); 254 "TEST_ID",
255 TestingProfile::TestingFactories());
255 BrowserList::SetLastActive(browser()); 256 BrowserList::SetLastActive(browser());
256 257
257 NSMenu* menu = [controller() menu]; 258 NSMenu* menu = [controller() menu];
258 ASSERT_EQ(6, [menu numberOfItems]); 259 ASSERT_EQ(6, [menu numberOfItems]);
259 NSMenuItem* item = [menu itemAtIndex:0]; 260 NSMenuItem* item = [menu itemAtIndex:0];
260 ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]); 261 ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]);
261 EXPECT_TRUE([controller() validateMenuItem:item]); 262 EXPECT_TRUE([controller() validateMenuItem:item]);
262 263
263 item = [menu itemAtIndex:1]; 264 item = [menu itemAtIndex:1];
264 ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]); 265 ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]);
(...skipping 15 matching lines...) Expand all
280 EXPECT_FALSE([controller() validateMenuItem:item]); 281 EXPECT_FALSE([controller() validateMenuItem:item]);
281 282
282 item = [menu itemAtIndex:1]; 283 item = [menu itemAtIndex:1];
283 ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]); 284 ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]);
284 EXPECT_TRUE([controller() validateMenuItem:item]); 285 EXPECT_TRUE([controller() validateMenuItem:item]);
285 286
286 item = [menu itemAtIndex:5]; 287 item = [menu itemAtIndex:5];
287 ASSERT_EQ(@selector(newProfile:), [item action]); 288 ASSERT_EQ(@selector(newProfile:), [item action]);
288 EXPECT_FALSE([controller() validateMenuItem:item]); 289 EXPECT_FALSE([controller() validateMenuItem:item]);
289 } 290 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller_unittest.mm ('k') | chrome/test/base/testing_profile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698