| 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_chooser_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #import "base/mac/foundation_util.h" | 8 #import "base/mac/foundation_util.h" |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/strings/sys_string_conversions.h" | 11 #include "base/strings/sys_string_conversions.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/browser/prefs/pref_service_syncable.h" | 13 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 14 #include "chrome/browser/profiles/avatar_menu.h" | 14 #include "chrome/browser/profiles/avatar_menu.h" |
| 15 #include "chrome/browser/profiles/profile_info_cache.h" | 15 #include "chrome/browser/profiles/profile_info_cache.h" |
| 16 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" | 16 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" |
| 17 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | 17 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
| 18 #include "chrome/browser/signin/account_fetcher_service_factory.h" | 18 #include "chrome/browser/signin/account_fetcher_service_factory.h" |
| 19 #include "chrome/browser/signin/chrome_signin_helper.h" | 19 #include "chrome/browser/signin/chrome_signin_helper.h" |
| 20 #include "chrome/browser/signin/fake_account_fetcher_service.h" | 20 #include "chrome/browser/signin/fake_account_fetcher_service.h" |
| 21 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" | |
| 22 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" | 21 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" |
| 23 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 22 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 24 #include "chrome/browser/signin/signin_manager_factory.h" | 23 #include "chrome/browser/signin/signin_manager_factory.h" |
| 25 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
| 26 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 25 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
| 27 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" |
| 29 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 29 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 30 #include "components/signin/core/browser/signin_manager.h" | 30 #include "components/signin/core/browser/signin_manager.h" |
| 31 #include "components/signin/core/common/profile_management_switches.h" | 31 #include "components/signin/core/common/profile_management_switches.h" |
| 32 | 32 |
| 33 const std::string kGaiaId = "gaiaid-user@gmail.com"; | 33 const std::string kGaiaId = "gaiaid-user@gmail.com"; |
| 34 const std::string kEmail = "user@gmail.com"; | 34 const std::string kEmail = "user@gmail.com"; |
| 35 const std::string kSecondaryEmail = "user2@gmail.com"; | 35 const std::string kSecondaryEmail = "user2@gmail.com"; |
| 36 const std::string kLoginToken = "oauth2_login_token"; | 36 const std::string kLoginToken = "oauth2_login_token"; |
| 37 | 37 |
| 38 class ProfileChooserControllerTest : public CocoaProfileTest { | 38 class ProfileChooserControllerTest : public CocoaProfileTest { |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 ASSERT_EQ(5U, [buttonSubviews count]); | 551 ASSERT_EQ(5U, [buttonSubviews count]); |
| 552 | 552 |
| 553 // There should be a lock button. | 553 // There should be a lock button. |
| 554 NSButton* lockButton = | 554 NSButton* lockButton = |
| 555 base::mac::ObjCCast<NSButton>([buttonSubviews objectAtIndex:0]); | 555 base::mac::ObjCCast<NSButton>([buttonSubviews objectAtIndex:0]); |
| 556 ASSERT_TRUE(lockButton); | 556 ASSERT_TRUE(lockButton); |
| 557 EXPECT_EQ(@selector(lockProfile:), [lockButton action]); | 557 EXPECT_EQ(@selector(lockProfile:), [lockButton action]); |
| 558 EXPECT_EQ(controller(), [lockButton target]); | 558 EXPECT_EQ(controller(), [lockButton target]); |
| 559 EXPECT_TRUE([lockButton isEnabled]); | 559 EXPECT_TRUE([lockButton isEnabled]); |
| 560 } | 560 } |
| OLD | NEW |