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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // CloudPolicyClient fetch the DMToken. | 241 // CloudPolicyClient fetch the DMToken. |
242 ASSERT_FALSE(policy_manager->core()->client()->is_registered()); | 242 ASSERT_FALSE(policy_manager->core()->client()->is_registered()); |
243 em::DeviceRegisterRequest::Type registration_type = | 243 em::DeviceRegisterRequest::Type registration_type = |
244 #if defined(OS_CHROMEOS) | 244 #if defined(OS_CHROMEOS) |
245 em::DeviceRegisterRequest::USER; | 245 em::DeviceRegisterRequest::USER; |
246 #else | 246 #else |
247 em::DeviceRegisterRequest::BROWSER; | 247 em::DeviceRegisterRequest::BROWSER; |
248 #endif | 248 #endif |
249 policy_manager->core()->client()->Register( | 249 policy_manager->core()->client()->Register( |
250 registration_type, em::DeviceRegisterRequest::FLAVOR_USER_REGISTRATION, | 250 registration_type, em::DeviceRegisterRequest::FLAVOR_USER_REGISTRATION, |
251 "bogus", std::string(), std::string(), std::string()); | 251 em::LicenseType::UNDEFINED, "bogus", std::string(), std::string(), |
| 252 std::string()); |
252 run_loop.Run(); | 253 run_loop.Run(); |
253 Mock::VerifyAndClearExpectations(&observer); | 254 Mock::VerifyAndClearExpectations(&observer); |
254 policy_manager->core()->client()->RemoveObserver(&observer); | 255 policy_manager->core()->client()->RemoveObserver(&observer); |
255 EXPECT_TRUE(policy_manager->core()->client()->is_registered()); | 256 EXPECT_TRUE(policy_manager->core()->client()->is_registered()); |
256 | 257 |
257 #if defined(OS_CHROMEOS) | 258 #if defined(OS_CHROMEOS) |
258 // Get the path to the user policy key file. | 259 // Get the path to the user policy key file. |
259 base::FilePath user_policy_key_dir; | 260 base::FilePath user_policy_key_dir; |
260 ASSERT_TRUE( | 261 ASSERT_TRUE( |
261 PathService::Get(chromeos::DIR_USER_POLICY_KEYS, &user_policy_key_dir)); | 262 PathService::Get(chromeos::DIR_USER_POLICY_KEYS, &user_policy_key_dir)); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 494 |
494 // They should now serialize to the same bytes. | 495 // They should now serialize to the same bytes. |
495 std::string chrome_settings_serialized; | 496 std::string chrome_settings_serialized; |
496 std::string cloud_policy_serialized; | 497 std::string cloud_policy_serialized; |
497 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); | 498 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); |
498 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); | 499 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); |
499 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); | 500 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); |
500 } | 501 } |
501 | 502 |
502 } // namespace policy | 503 } // namespace policy |
OLD | NEW |