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 "chrome/browser/chromeos/policy/device_local_account_policy_service.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 const em::PolicyFetchRequest* extensions = | 429 const em::PolicyFetchRequest* extensions = |
430 &request.policy_request().request(1); | 430 &request.policy_request().request(1); |
431 // The order is not guarateed. | 431 // The order is not guarateed. |
432 if (extensions->policy_type() == | 432 if (extensions->policy_type() == |
433 dm_protocol::kChromePublicAccountPolicyType) { | 433 dm_protocol::kChromePublicAccountPolicyType) { |
434 std::swap(public_account, extensions); | 434 std::swap(public_account, extensions); |
435 } | 435 } |
436 | 436 |
437 EXPECT_EQ(dm_protocol::kChromePublicAccountPolicyType, | 437 EXPECT_EQ(dm_protocol::kChromePublicAccountPolicyType, |
438 public_account->policy_type()); | 438 public_account->policy_type()); |
439 EXPECT_FALSE(public_account->has_machine_id()); | |
440 EXPECT_EQ(kAccount1, public_account->settings_entity_id()); | 439 EXPECT_EQ(kAccount1, public_account->settings_entity_id()); |
441 | 440 |
442 EXPECT_EQ(dm_protocol::kChromeExtensionPolicyType, | 441 EXPECT_EQ(dm_protocol::kChromeExtensionPolicyType, |
443 extensions->policy_type()); | 442 extensions->policy_type()); |
444 EXPECT_FALSE(extensions->has_machine_id()); | |
445 EXPECT_FALSE(extensions->has_settings_entity_id()); | 443 EXPECT_FALSE(extensions->has_settings_entity_id()); |
446 | 444 |
447 ASSERT_TRUE(broker->core()->store()); | 445 ASSERT_TRUE(broker->core()->store()); |
448 EXPECT_EQ(CloudPolicyStore::STATUS_OK, | 446 EXPECT_EQ(CloudPolicyStore::STATUS_OK, |
449 broker->core()->store()->status()); | 447 broker->core()->store()->status()); |
450 ASSERT_TRUE(broker->core()->store()->policy()); | 448 ASSERT_TRUE(broker->core()->store()->policy()); |
451 EXPECT_EQ(device_local_account_policy_.policy_data().SerializeAsString(), | 449 EXPECT_EQ(device_local_account_policy_.policy_data().SerializeAsString(), |
452 broker->core()->store()->policy()->SerializeAsString()); | 450 broker->core()->store()->policy()->SerializeAsString()); |
453 EXPECT_TRUE(expected_policy_map_.Equals( | 451 EXPECT_TRUE(expected_policy_map_.Equals( |
454 broker->core()->store()->policy_map())); | 452 broker->core()->store()->policy_map())); |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 | 1028 |
1031 provider_ = DeviceLocalAccountPolicyProvider::Create( | 1029 provider_ = DeviceLocalAccountPolicyProvider::Create( |
1032 GenerateDeviceLocalAccountUserId(kAccount1, | 1030 GenerateDeviceLocalAccountUserId(kAccount1, |
1033 DeviceLocalAccount::TYPE_PUBLIC_SESSION), | 1031 DeviceLocalAccount::TYPE_PUBLIC_SESSION), |
1034 service_.get(), true /*force_immediate_load*/); | 1032 service_.get(), true /*force_immediate_load*/); |
1035 | 1033 |
1036 EXPECT_TRUE(provider_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); | 1034 EXPECT_TRUE(provider_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); |
1037 } | 1035 } |
1038 | 1036 |
1039 } // namespace policy | 1037 } // namespace policy |
OLD | NEW |