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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void SetUpOnMainThread() override { | 200 void SetUpOnMainThread() override { |
201 ASSERT_TRUE(PolicyServiceIsEmpty(g_browser_process->policy_service())) | 201 ASSERT_TRUE(PolicyServiceIsEmpty(g_browser_process->policy_service())) |
202 << "Pre-existing policies in this machine will make this test fail."; | 202 << "Pre-existing policies in this machine will make this test fail."; |
203 | 203 |
204 BrowserPolicyConnector* connector = | 204 BrowserPolicyConnector* connector = |
205 g_browser_process->browser_policy_connector(); | 205 g_browser_process->browser_policy_connector(); |
206 connector->ScheduleServiceInitialization(0); | 206 connector->ScheduleServiceInitialization(0); |
207 | 207 |
208 #if defined(OS_CHROMEOS) | 208 #if defined(OS_CHROMEOS) |
209 UserCloudPolicyManagerChromeOS* policy_manager = | 209 UserCloudPolicyManagerChromeOS* policy_manager = |
210 UserCloudPolicyManagerFactoryChromeOS::GetForProfile( | 210 UserCloudPolicyManagerFactoryChromeOS::GetCloudPolicyManagerForProfile( |
211 browser()->profile()); | 211 browser()->profile()); |
212 ASSERT_TRUE(policy_manager); | 212 ASSERT_TRUE(policy_manager); |
213 #else | 213 #else |
214 // Mock a signed-in user. This is used by the UserCloudPolicyStore to pass | 214 // Mock a signed-in user. This is used by the UserCloudPolicyStore to pass |
215 // the username to the UserCloudPolicyValidator. | 215 // the username to the UserCloudPolicyValidator. |
216 SigninManager* signin_manager = | 216 SigninManager* signin_manager = |
217 SigninManagerFactory::GetForProfile(browser()->profile()); | 217 SigninManagerFactory::GetForProfile(browser()->profile()); |
218 ASSERT_TRUE(signin_manager); | 218 ASSERT_TRUE(signin_manager); |
219 signin_manager->SetAuthenticatedAccountInfo(GetTestGaiaId(), GetTestUser()); | 219 signin_manager->SetAuthenticatedAccountInfo(GetTestGaiaId(), GetTestUser()); |
220 | 220 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 491 |
492 // They should now serialize to the same bytes. | 492 // They should now serialize to the same bytes. |
493 std::string chrome_settings_serialized; | 493 std::string chrome_settings_serialized; |
494 std::string cloud_policy_serialized; | 494 std::string cloud_policy_serialized; |
495 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); | 495 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); |
496 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); | 496 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); |
497 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); | 497 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); |
498 } | 498 } |
499 | 499 |
500 } // namespace policy | 500 } // namespace policy |
OLD | NEW |