| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/configuration_policy_provider_test.h" | 5 #include "components/policy/core/common/configuration_policy_provider_test.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 base::StringValue expected_value(kTestString); | 256 base::StringValue expected_value(kTestString); |
| 257 CheckValue(test_keys::kKeyString, | 257 CheckValue(test_keys::kKeyString, |
| 258 expected_value, | 258 expected_value, |
| 259 base::Bind(&PolicyProviderTestHarness::InstallStringPolicy, | 259 base::Bind(&PolicyProviderTestHarness::InstallStringPolicy, |
| 260 base::Unretained(test_harness_.get()), | 260 base::Unretained(test_harness_.get()), |
| 261 test_keys::kKeyString, | 261 test_keys::kKeyString, |
| 262 kTestString)); | 262 kTestString)); |
| 263 } | 263 } |
| 264 | 264 |
| 265 TEST_P(ConfigurationPolicyProviderTest, BooleanValue) { | 265 TEST_P(ConfigurationPolicyProviderTest, BooleanValue) { |
| 266 base::FundamentalValue expected_value(true); | 266 base::Value expected_value(true); |
| 267 CheckValue(test_keys::kKeyBoolean, | 267 CheckValue(test_keys::kKeyBoolean, |
| 268 expected_value, | 268 expected_value, |
| 269 base::Bind(&PolicyProviderTestHarness::InstallBooleanPolicy, | 269 base::Bind(&PolicyProviderTestHarness::InstallBooleanPolicy, |
| 270 base::Unretained(test_harness_.get()), | 270 base::Unretained(test_harness_.get()), |
| 271 test_keys::kKeyBoolean, | 271 test_keys::kKeyBoolean, |
| 272 true)); | 272 true)); |
| 273 } | 273 } |
| 274 | 274 |
| 275 TEST_P(ConfigurationPolicyProviderTest, IntegerValue) { | 275 TEST_P(ConfigurationPolicyProviderTest, IntegerValue) { |
| 276 base::FundamentalValue expected_value(42); | 276 base::Value expected_value(42); |
| 277 CheckValue(test_keys::kKeyInteger, | 277 CheckValue(test_keys::kKeyInteger, |
| 278 expected_value, | 278 expected_value, |
| 279 base::Bind(&PolicyProviderTestHarness::InstallIntegerPolicy, | 279 base::Bind(&PolicyProviderTestHarness::InstallIntegerPolicy, |
| 280 base::Unretained(test_harness_.get()), | 280 base::Unretained(test_harness_.get()), |
| 281 test_keys::kKeyInteger, | 281 test_keys::kKeyInteger, |
| 282 42)); | 282 42)); |
| 283 } | 283 } |
| 284 | 284 |
| 285 TEST_P(ConfigurationPolicyProviderTest, StringListValue) { | 285 TEST_P(ConfigurationPolicyProviderTest, StringListValue) { |
| 286 base::ListValue expected_value; | 286 base::ListValue expected_value; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, | 415 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, |
| 416 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) | 416 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) |
| 417 .CopyFrom(expected_policy); | 417 .CopyFrom(expected_policy); |
| 418 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, | 418 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, |
| 419 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")) | 419 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")) |
| 420 .CopyFrom(expected_policy); | 420 .CopyFrom(expected_policy); |
| 421 EXPECT_TRUE(provider_->policies().Equals(expected_bundle)); | 421 EXPECT_TRUE(provider_->policies().Equals(expected_bundle)); |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace policy | 424 } // namespace policy |
| OLD | NEW |