| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 void TearDownOnMainThread() override { | 92 void TearDownOnMainThread() override { |
| 93 // Verify that all the expected requests were handled. | 93 // Verify that all the expected requests were handled. |
| 94 EXPECT_EQ(0u, interceptor_->GetPendingSize()); | 94 EXPECT_EQ(0u, interceptor_->GetPendingSize()); |
| 95 | 95 |
| 96 interceptor_.reset(); | 96 interceptor_.reset(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 #if defined(OS_CHROMEOS) | 99 #if defined(OS_CHROMEOS) |
| 100 UserCloudPolicyManagerChromeOS* policy_manager() { | 100 UserCloudPolicyManagerChromeOS* policy_manager() { |
| 101 return UserCloudPolicyManagerFactoryChromeOS::GetForProfile( | 101 return UserCloudPolicyManagerFactoryChromeOS:: |
| 102 browser()->profile()); | 102 GetCloudPolicyManagerForProfile(browser()->profile()); |
| 103 } | 103 } |
| 104 #else | 104 #else |
| 105 UserCloudPolicyManager* policy_manager() { | 105 UserCloudPolicyManager* policy_manager() { |
| 106 return UserCloudPolicyManagerFactory::GetForBrowserContext( | 106 return UserCloudPolicyManagerFactory::GetForBrowserContext( |
| 107 browser()->profile()); | 107 browser()->profile()); |
| 108 } | 108 } |
| 109 #endif // defined(OS_CHROMEOS) | 109 #endif // defined(OS_CHROMEOS) |
| 110 | 110 |
| 111 // Register the client of the policy_manager() using a bogus auth token, and | 111 // Register the client of the policy_manager() using a bogus auth token, and |
| 112 // returns once the registration gets a result back. | 112 // returns once the registration gets a result back. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 const bool expect_reregister = true; | 197 const bool expect_reregister = true; |
| 198 interceptor_->PushJobCallback( | 198 interceptor_->PushJobCallback( |
| 199 TestRequestInterceptor::RegisterJob(expected_type, expect_reregister)); | 199 TestRequestInterceptor::RegisterJob(expected_type, expect_reregister)); |
| 200 | 200 |
| 201 EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); | 201 EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); |
| 202 ASSERT_NO_FATAL_FAILURE(Register()); | 202 ASSERT_NO_FATAL_FAILURE(Register()); |
| 203 EXPECT_TRUE(policy_manager()->core()->client()->is_registered()); | 203 EXPECT_TRUE(policy_manager()->core()->client()->is_registered()); |
| 204 } | 204 } |
| 205 | 205 |
| 206 } // namespace policy | 206 } // namespace policy |
| OLD | NEW |