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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // Give a bogus OAuth token to the |policy_manager|. This should make its | 187 // Give a bogus OAuth token to the |policy_manager|. This should make its |
188 // CloudPolicyClient fetch the DMToken. | 188 // CloudPolicyClient fetch the DMToken. |
189 ASSERT_FALSE(policy_manager->core()->client()->is_registered()); | 189 ASSERT_FALSE(policy_manager->core()->client()->is_registered()); |
190 em::DeviceRegisterRequest::Type registration_type = | 190 em::DeviceRegisterRequest::Type registration_type = |
191 #if defined(OS_CHROMEOS) | 191 #if defined(OS_CHROMEOS) |
192 em::DeviceRegisterRequest::USER; | 192 em::DeviceRegisterRequest::USER; |
193 #else | 193 #else |
194 em::DeviceRegisterRequest::BROWSER; | 194 em::DeviceRegisterRequest::BROWSER; |
195 #endif | 195 #endif |
196 policy_manager->core()->client()->Register( | 196 policy_manager->core()->client()->Register( |
197 registration_type, "bogus", std::string(), false); | 197 registration_type, "bogus", std::string(), false, std::string()); |
198 run_loop.Run(); | 198 run_loop.Run(); |
199 Mock::VerifyAndClearExpectations(&observer); | 199 Mock::VerifyAndClearExpectations(&observer); |
200 policy_manager->core()->client()->RemoveObserver(&observer); | 200 policy_manager->core()->client()->RemoveObserver(&observer); |
201 EXPECT_TRUE(policy_manager->core()->client()->is_registered()); | 201 EXPECT_TRUE(policy_manager->core()->client()->is_registered()); |
202 | 202 |
203 #if defined(OS_CHROMEOS) | 203 #if defined(OS_CHROMEOS) |
204 // Get the path to the user policy key file. | 204 // Get the path to the user policy key file. |
205 base::FilePath user_policy_key_dir; | 205 base::FilePath user_policy_key_dir; |
206 ASSERT_TRUE( | 206 ASSERT_TRUE( |
207 PathService::Get(chromeos::DIR_USER_POLICY_KEYS, &user_policy_key_dir)); | 207 PathService::Get(chromeos::DIR_USER_POLICY_KEYS, &user_policy_key_dir)); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 | 355 |
356 // They should now serialize to the same bytes. | 356 // They should now serialize to the same bytes. |
357 std::string chrome_settings_serialized; | 357 std::string chrome_settings_serialized; |
358 std::string cloud_policy_serialized; | 358 std::string cloud_policy_serialized; |
359 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); | 359 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); |
360 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); | 360 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); |
361 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); | 361 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); |
362 } | 362 } |
363 | 363 |
364 } // namespace policy | 364 } // namespace policy |
OLD | NEW |