| 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 "components/policy/core/common/cloud/cloud_policy_manager.h" | 5 #include "components/policy/core/common/cloud/cloud_policy_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 void TestHarness::InstallStringPolicy(const std::string& policy_name, | 89 void TestHarness::InstallStringPolicy(const std::string& policy_name, |
| 90 const std::string& policy_value) { | 90 const std::string& policy_value) { |
| 91 store_.policy_map_.Set( | 91 store_.policy_map_.Set( |
| 92 policy_name, policy_level(), policy_scope(), POLICY_SOURCE_CLOUD, | 92 policy_name, policy_level(), policy_scope(), POLICY_SOURCE_CLOUD, |
| 93 base::MakeUnique<base::StringValue>(policy_value), nullptr); | 93 base::MakeUnique<base::StringValue>(policy_value), nullptr); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void TestHarness::InstallIntegerPolicy(const std::string& policy_name, | 96 void TestHarness::InstallIntegerPolicy(const std::string& policy_name, |
| 97 int policy_value) { | 97 int policy_value) { |
| 98 store_.policy_map_.Set( | 98 store_.policy_map_.Set(policy_name, policy_level(), policy_scope(), |
| 99 policy_name, policy_level(), policy_scope(), POLICY_SOURCE_CLOUD, | 99 POLICY_SOURCE_CLOUD, |
| 100 base::MakeUnique<base::FundamentalValue>(policy_value), nullptr); | 100 base::MakeUnique<base::Value>(policy_value), nullptr); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void TestHarness::InstallBooleanPolicy(const std::string& policy_name, | 103 void TestHarness::InstallBooleanPolicy(const std::string& policy_name, |
| 104 bool policy_value) { | 104 bool policy_value) { |
| 105 store_.policy_map_.Set( | 105 store_.policy_map_.Set(policy_name, policy_level(), policy_scope(), |
| 106 policy_name, policy_level(), policy_scope(), POLICY_SOURCE_CLOUD, | 106 POLICY_SOURCE_CLOUD, |
| 107 base::MakeUnique<base::FundamentalValue>(policy_value), nullptr); | 107 base::MakeUnique<base::Value>(policy_value), nullptr); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void TestHarness::InstallStringListPolicy(const std::string& policy_name, | 110 void TestHarness::InstallStringListPolicy(const std::string& policy_name, |
| 111 const base::ListValue* policy_value) { | 111 const base::ListValue* policy_value) { |
| 112 store_.policy_map_.Set(policy_name, policy_level(), policy_scope(), | 112 store_.policy_map_.Set(policy_name, policy_level(), policy_scope(), |
| 113 POLICY_SOURCE_CLOUD, policy_value->CreateDeepCopy(), | 113 POLICY_SOURCE_CLOUD, policy_value->CreateDeepCopy(), |
| 114 nullptr); | 114 nullptr); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void TestHarness::InstallDictionaryPolicy( | 117 void TestHarness::InstallDictionaryPolicy( |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 store_.policy_.reset(new em::PolicyData(policy_.policy_data())); | 348 store_.policy_.reset(new em::PolicyData(policy_.policy_data())); |
| 349 EXPECT_CALL(observer_, OnUpdatePolicy(manager_.get())); | 349 EXPECT_CALL(observer_, OnUpdatePolicy(manager_.get())); |
| 350 store_.NotifyStoreError(); | 350 store_.NotifyStoreError(); |
| 351 Mock::VerifyAndClearExpectations(&observer_); | 351 Mock::VerifyAndClearExpectations(&observer_); |
| 352 | 352 |
| 353 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); | 353 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); |
| 354 } | 354 } |
| 355 | 355 |
| 356 } // namespace | 356 } // namespace |
| 357 } // namespace policy | 357 } // namespace policy |
| OLD | NEW |