| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  242   const bool io_was_allowed = base::ThreadRestrictions::SetIOAllowed(false); |  242   const bool io_was_allowed = base::ThreadRestrictions::SetIOAllowed(false); | 
|  243   [controller() activeBrowserChangedTo:NULL]; |  243   [controller() activeBrowserChangedTo:NULL]; | 
|  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                                     base::ASCIIToUTF16("Supervised User"), | 
|  253                                     0, |  253                                     0, | 
|  254                                     "TEST_ID", |  254                                     "TEST_ID", | 
|  255                                     TestingProfile::TestingFactories()); |  255                                     TestingProfile::TestingFactories()); | 
|  256   BrowserList::SetLastActive(browser()); |  256   BrowserList::SetLastActive(browser()); | 
|  257  |  257  | 
|  258   NSMenu* menu = [controller() menu]; |  258   NSMenu* menu = [controller() menu]; | 
|  259   ASSERT_EQ(6, [menu numberOfItems]); |  259   ASSERT_EQ(6, [menu numberOfItems]); | 
|  260   NSMenuItem* item = [menu itemAtIndex:0]; |  260   NSMenuItem* item = [menu itemAtIndex:0]; | 
|  261   ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]); |  261   ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]); | 
|  262   EXPECT_TRUE([controller() validateMenuItem:item]); |  262   EXPECT_TRUE([controller() validateMenuItem:item]); | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
|  281   EXPECT_FALSE([controller() validateMenuItem:item]); |  281   EXPECT_FALSE([controller() validateMenuItem:item]); | 
|  282  |  282  | 
|  283   item = [menu itemAtIndex:1]; |  283   item = [menu itemAtIndex:1]; | 
|  284   ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]); |  284   ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]); | 
|  285   EXPECT_TRUE([controller() validateMenuItem:item]); |  285   EXPECT_TRUE([controller() validateMenuItem:item]); | 
|  286  |  286  | 
|  287   item = [menu itemAtIndex:5]; |  287   item = [menu itemAtIndex:5]; | 
|  288   ASSERT_EQ(@selector(newProfile:), [item action]); |  288   ASSERT_EQ(@selector(newProfile:), [item action]); | 
|  289   EXPECT_FALSE([controller() validateMenuItem:item]); |  289   EXPECT_FALSE([controller() validateMenuItem:item]); | 
|  290 } |  290 } | 
| OLD | NEW |