OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |