| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 7 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 8 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
| 9 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 10 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 12 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 13 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
| 13 #include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h" | 14 #include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h" |
| 14 #include "chrome/browser/prefs/browser_prefs.h" | 15 #include "chrome/browser/prefs/browser_prefs.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 : FakeSigninManager(profile) { | 89 : FakeSigninManager(profile) { |
| 89 Initialize(NULL); | 90 Initialize(NULL); |
| 90 } | 91 } |
| 91 | 92 |
| 92 void ForceSignOut() { | 93 void ForceSignOut() { |
| 93 // Allow signing out now. | 94 // Allow signing out now. |
| 94 prohibit_signout_ = false; | 95 prohibit_signout_ = false; |
| 95 SignOut(signin_metrics::SIGNOUT_TEST); | 96 SignOut(signin_metrics::SIGNOUT_TEST); |
| 96 } | 97 } |
| 97 | 98 |
| 98 static KeyedService* Build(content::BrowserContext* profile) { | 99 static scoped_ptr<KeyedService> Build(content::BrowserContext* profile) { |
| 99 return new SigninManagerFake(static_cast<Profile*>(profile)); | 100 return make_scoped_ptr( |
| 101 new SigninManagerFake(static_cast<Profile*>(profile))); |
| 100 } | 102 } |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 UserCloudPolicyManager* BuildCloudPolicyManager( | 105 UserCloudPolicyManager* BuildCloudPolicyManager( |
| 104 content::BrowserContext* context) { | 106 content::BrowserContext* context) { |
| 105 MockUserCloudPolicyStore* store = new MockUserCloudPolicyStore(); | 107 MockUserCloudPolicyStore* store = new MockUserCloudPolicyStore(); |
| 106 EXPECT_CALL(*store, Load()).Times(AnyNumber()); | 108 EXPECT_CALL(*store, Load()).Times(AnyNumber()); |
| 107 | 109 |
| 108 return new UserCloudPolicyManager( | 110 return new UserCloudPolicyManager( |
| 109 scoped_ptr<UserCloudPolicyStore>(store), | 111 scoped_ptr<UserCloudPolicyStore>(store), |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 base::RunLoop().RunUntilIdle(); | 832 base::RunLoop().RunUntilIdle(); |
| 831 EXPECT_FALSE(manager_->IsClientRegistered()); | 833 EXPECT_FALSE(manager_->IsClientRegistered()); |
| 832 #if !defined(OS_ANDROID) | 834 #if !defined(OS_ANDROID) |
| 833 EXPECT_FALSE(signin_manager_->IsSignoutProhibited()); | 835 EXPECT_FALSE(signin_manager_->IsSignoutProhibited()); |
| 834 #endif | 836 #endif |
| 835 } | 837 } |
| 836 | 838 |
| 837 } // namespace | 839 } // namespace |
| 838 | 840 |
| 839 } // namespace policy | 841 } // namespace policy |
| OLD | NEW |