| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profiles/profile_menu_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/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" |
| 11 #include "chrome/browser/prefs/pref_service_syncable.h" | |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/ui/browser_list.h" | 12 #include "chrome/browser/ui/browser_list.h" |
| 14 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 13 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
| 15 #include "chrome/browser/ui/cocoa/run_loop_testing.h" | 14 #include "chrome/browser/ui/cocoa/run_loop_testing.h" |
| 16 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 17 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
| 18 #include "chrome/test/base/test_browser_window.h" | 17 #include "chrome/test/base/test_browser_window.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
| 19 #include "components/syncable_prefs/pref_service_syncable.h" |
| 20 #include "testing/gtest_mac.h" | 20 #include "testing/gtest_mac.h" |
| 21 #include "ui/base/l10n/l10n_util_mac.h" | 21 #include "ui/base/l10n/l10n_util_mac.h" |
| 22 | 22 |
| 23 class ProfileMenuControllerTest : public CocoaProfileTest { | 23 class ProfileMenuControllerTest : public CocoaProfileTest { |
| 24 public: | 24 public: |
| 25 ProfileMenuControllerTest() { | 25 ProfileMenuControllerTest() { |
| 26 item_.reset([[NSMenuItem alloc] initWithTitle:@"Users" | 26 item_.reset([[NSMenuItem alloc] initWithTitle:@"Users" |
| 27 action:nil | 27 action:nil |
| 28 keyEquivalent:@""]); | 28 keyEquivalent:@""]); |
| 29 controller_.reset( | 29 controller_.reset( |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 EXPECT_FALSE([controller() validateMenuItem:item]); | 291 EXPECT_FALSE([controller() validateMenuItem:item]); |
| 292 | 292 |
| 293 item = [menu itemAtIndex:1]; | 293 item = [menu itemAtIndex:1]; |
| 294 ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]); | 294 ASSERT_EQ(@selector(switchToProfileFromMenu:), [item action]); |
| 295 EXPECT_TRUE([controller() validateMenuItem:item]); | 295 EXPECT_TRUE([controller() validateMenuItem:item]); |
| 296 | 296 |
| 297 item = [menu itemAtIndex:5]; | 297 item = [menu itemAtIndex:5]; |
| 298 ASSERT_EQ(@selector(newProfile:), [item action]); | 298 ASSERT_EQ(@selector(newProfile:), [item action]); |
| 299 EXPECT_FALSE([controller() validateMenuItem:item]); | 299 EXPECT_FALSE([controller() validateMenuItem:item]); |
| 300 } | 300 } |
| OLD | NEW |