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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // Give a bogus OAuth token to the |policy_manager|. This should make its | 248 // Give a bogus OAuth token to the |policy_manager|. This should make its |
249 // CloudPolicyClient fetch the DMToken. | 249 // CloudPolicyClient fetch the DMToken. |
250 ASSERT_FALSE(policy_manager->core()->client()->is_registered()); | 250 ASSERT_FALSE(policy_manager->core()->client()->is_registered()); |
251 em::DeviceRegisterRequest::Type registration_type = | 251 em::DeviceRegisterRequest::Type registration_type = |
252 #if defined(OS_CHROMEOS) | 252 #if defined(OS_CHROMEOS) |
253 em::DeviceRegisterRequest::USER; | 253 em::DeviceRegisterRequest::USER; |
254 #else | 254 #else |
255 em::DeviceRegisterRequest::BROWSER; | 255 em::DeviceRegisterRequest::BROWSER; |
256 #endif | 256 #endif |
257 policy_manager->core()->client()->Register( | 257 policy_manager->core()->client()->Register( |
258 registration_type, "bogus", std::string(), false); | 258 registration_type, "bogus", std::string(), false, std::string()); |
259 run_loop.Run(); | 259 run_loop.Run(); |
260 Mock::VerifyAndClearExpectations(&observer); | 260 Mock::VerifyAndClearExpectations(&observer); |
261 policy_manager->core()->client()->RemoveObserver(&observer); | 261 policy_manager->core()->client()->RemoveObserver(&observer); |
262 EXPECT_TRUE(policy_manager->core()->client()->is_registered()); | 262 EXPECT_TRUE(policy_manager->core()->client()->is_registered()); |
263 } | 263 } |
264 | 264 |
265 #if defined(OS_CHROMEOS) | 265 #if defined(OS_CHROMEOS) |
266 base::FilePath user_policy_key_dir() { | 266 base::FilePath user_policy_key_dir() { |
267 return temp_dir_.path().AppendASCII("user_policy"); | 267 return temp_dir_.path().AppendASCII("user_policy"); |
268 } | 268 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 420 |
421 // They should now serialize to the same bytes. | 421 // They should now serialize to the same bytes. |
422 std::string chrome_settings_serialized; | 422 std::string chrome_settings_serialized; |
423 std::string cloud_policy_serialized; | 423 std::string cloud_policy_serialized; |
424 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); | 424 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); |
425 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); | 425 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); |
426 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); | 426 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); |
427 } | 427 } |
428 | 428 |
429 } // namespace policy | 429 } // namespace policy |
OLD | NEW |