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/callback.h" | 5 #include "base/callback.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 ASSERT_TRUE(signin_manager); | 186 ASSERT_TRUE(signin_manager); |
187 signin_manager->SetAuthenticatedUsername(GetTestUser()); | 187 signin_manager->SetAuthenticatedUsername(GetTestUser()); |
188 | 188 |
189 UserCloudPolicyManager* policy_manager = | 189 UserCloudPolicyManager* policy_manager = |
190 UserCloudPolicyManagerFactory::GetForBrowserContext( | 190 UserCloudPolicyManagerFactory::GetForBrowserContext( |
191 browser()->profile()); | 191 browser()->profile()); |
192 ASSERT_TRUE(policy_manager); | 192 ASSERT_TRUE(policy_manager); |
193 policy_manager->Connect( | 193 policy_manager->Connect( |
194 g_browser_process->local_state(), | 194 g_browser_process->local_state(), |
195 g_browser_process->system_request_context(), | 195 g_browser_process->system_request_context(), |
196 UserCloudPolicyManager::CreateCloudPolicyClient( | 196 policy_manager->CreateCloudPolicyClient( |
197 connector->device_management_service(), | 197 connector->device_management_service(), |
198 g_browser_process->system_request_context()).Pass()); | 198 g_browser_process->system_request_context()).Pass()); |
199 #endif // defined(OS_CHROMEOS) | 199 #endif // defined(OS_CHROMEOS) |
200 | 200 |
201 ASSERT_TRUE(policy_manager->core()->client()); | 201 ASSERT_TRUE(policy_manager->core()->client()); |
202 base::RunLoop run_loop; | 202 base::RunLoop run_loop; |
203 MockCloudPolicyClientObserver observer; | 203 MockCloudPolicyClientObserver observer; |
204 EXPECT_CALL(observer, OnRegistrationStateChanged(_)).WillOnce( | 204 EXPECT_CALL(observer, OnRegistrationStateChanged(_)).WillOnce( |
205 InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); | 205 InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); |
206 policy_manager->core()->client()->AddObserver(&observer); | 206 policy_manager->core()->client()->AddObserver(&observer); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 | 425 |
426 // They should now serialize to the same bytes. | 426 // They should now serialize to the same bytes. |
427 std::string chrome_settings_serialized; | 427 std::string chrome_settings_serialized; |
428 std::string cloud_policy_serialized; | 428 std::string cloud_policy_serialized; |
429 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); | 429 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); |
430 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); | 430 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); |
431 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); | 431 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); |
432 } | 432 } |
433 | 433 |
434 } // namespace policy | 434 } // namespace policy |
OLD | NEW |