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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/policy/cloud/test_request_interceptor.h" | 10 #include "chrome/browser/policy/cloud/test_request_interceptor.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 #if !defined(OS_CHROMEOS) | 71 #if !defined(OS_CHROMEOS) |
72 // Mock a signed-in user. This is used by the UserCloudPolicyStore to pass | 72 // Mock a signed-in user. This is used by the UserCloudPolicyStore to pass |
73 // the username to the UserCloudPolicyValidator. | 73 // the username to the UserCloudPolicyValidator. |
74 SigninManager* signin_manager = | 74 SigninManager* signin_manager = |
75 SigninManagerFactory::GetForProfile(browser()->profile()); | 75 SigninManagerFactory::GetForProfile(browser()->profile()); |
76 ASSERT_TRUE(signin_manager); | 76 ASSERT_TRUE(signin_manager); |
77 signin_manager->SetAuthenticatedAccountInfo("12345", "user@example.com"); | 77 signin_manager->SetAuthenticatedAccountInfo("12345", "user@example.com"); |
78 | 78 |
79 ASSERT_TRUE(policy_manager()); | 79 ASSERT_TRUE(policy_manager()); |
80 policy_manager()->Connect( | 80 policy_manager()->Connect(g_browser_process->local_state(), |
81 g_browser_process->local_state(), | 81 g_browser_process->system_request_context(), |
82 g_browser_process->system_request_context(), | 82 UserCloudPolicyManager::CreateCloudPolicyClient( |
83 UserCloudPolicyManager::CreateCloudPolicyClient( | 83 connector->device_management_service(), |
84 connector->device_management_service(), | 84 g_browser_process->system_request_context())); |
85 g_browser_process->system_request_context()).Pass()); | |
86 #endif | 85 #endif |
87 } | 86 } |
88 | 87 |
89 void TearDownOnMainThread() override { | 88 void TearDownOnMainThread() override { |
90 // Verify that all the expected requests were handled. | 89 // Verify that all the expected requests were handled. |
91 EXPECT_EQ(0u, interceptor_->GetPendingSize()); | 90 EXPECT_EQ(0u, interceptor_->GetPendingSize()); |
92 | 91 |
93 interceptor_.reset(); | 92 interceptor_.reset(); |
94 } | 93 } |
95 | 94 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 const bool expect_reregister = true; | 193 const bool expect_reregister = true; |
195 interceptor_->PushJobCallback( | 194 interceptor_->PushJobCallback( |
196 TestRequestInterceptor::RegisterJob(expected_type, expect_reregister)); | 195 TestRequestInterceptor::RegisterJob(expected_type, expect_reregister)); |
197 | 196 |
198 EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); | 197 EXPECT_FALSE(policy_manager()->core()->client()->is_registered()); |
199 ASSERT_NO_FATAL_FAILURE(Register()); | 198 ASSERT_NO_FATAL_FAILURE(Register()); |
200 EXPECT_TRUE(policy_manager()->core()->client()->is_registered()); | 199 EXPECT_TRUE(policy_manager()->core()->client()->is_registered()); |
201 } | 200 } |
202 | 201 |
203 } // namespace policy | 202 } // namespace policy |
OLD | NEW |