| 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_cloud_policy_store_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 EXPECT_FALSE(store_->has_policy()); | 78 EXPECT_FALSE(store_->has_policy()); |
| 79 EXPECT_FALSE(store_->is_managed()); | 79 EXPECT_FALSE(store_->is_managed()); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void ExpectSuccess() { | 82 void ExpectSuccess() { |
| 83 EXPECT_EQ(CloudPolicyStore::STATUS_OK, store_->status()); | 83 EXPECT_EQ(CloudPolicyStore::STATUS_OK, store_->status()); |
| 84 EXPECT_TRUE(store_->is_initialized()); | 84 EXPECT_TRUE(store_->is_initialized()); |
| 85 EXPECT_TRUE(store_->has_policy()); | 85 EXPECT_TRUE(store_->has_policy()); |
| 86 EXPECT_TRUE(store_->is_managed()); | 86 EXPECT_TRUE(store_->is_managed()); |
| 87 EXPECT_TRUE(store_->policy()); | 87 EXPECT_TRUE(store_->policy()); |
| 88 base::FundamentalValue expected(false); | 88 base::Value expected(false); |
| 89 EXPECT_TRUE( | 89 EXPECT_TRUE( |
| 90 base::Value::Equals(&expected, | 90 base::Value::Equals(&expected, |
| 91 store_->policy_map().GetValue( | 91 store_->policy_map().GetValue( |
| 92 key::kDeviceMetricsReportingEnabled))); | 92 key::kDeviceMetricsReportingEnabled))); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void PrepareExistingPolicy() { | 95 void PrepareExistingPolicy() { |
| 96 store_->Load(); | 96 store_->Load(); |
| 97 FlushDeviceSettings(); | 97 FlushDeviceSettings(); |
| 98 ExpectSuccess(); | 98 ExpectSuccess(); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 TEST_F(DeviceCloudPolicyStoreChromeOSTest, InstallInitialPolicyNotEnterprise) { | 278 TEST_F(DeviceCloudPolicyStoreChromeOSTest, InstallInitialPolicyNotEnterprise) { |
| 279 PrepareNewSigningKey(); | 279 PrepareNewSigningKey(); |
| 280 ResetToNonEnterprise(); | 280 ResetToNonEnterprise(); |
| 281 store_->InstallInitialPolicy(device_policy_.policy()); | 281 store_->InstallInitialPolicy(device_policy_.policy()); |
| 282 FlushDeviceSettings(); | 282 FlushDeviceSettings(); |
| 283 ExpectFailure(CloudPolicyStore::STATUS_BAD_STATE); | 283 ExpectFailure(CloudPolicyStore::STATUS_BAD_STATE); |
| 284 } | 284 } |
| 285 | 285 |
| 286 } // namespace policy | 286 } // namespace policy |
| OLD | NEW |