Chromium Code Reviews| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/prefs/pref_store_observer_mock.h" | 10 #include "base/prefs/pref_store_observer_mock.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 prefs::kPluginsEnabledPlugins), | 109 prefs::kPluginsEnabledPlugins), |
| 110 PolicyAndPref(key::kDisabledSchemes, | 110 PolicyAndPref(key::kDisabledSchemes, |
| 111 prefs::kDisabledSchemes), | 111 prefs::kDisabledSchemes), |
| 112 PolicyAndPref(key::kAutoSelectCertificateForUrls, | 112 PolicyAndPref(key::kAutoSelectCertificateForUrls, |
| 113 prefs::kManagedAutoSelectCertificateForUrls), | 113 prefs::kManagedAutoSelectCertificateForUrls), |
| 114 PolicyAndPref(key::kURLBlacklist, | 114 PolicyAndPref(key::kURLBlacklist, |
| 115 prefs::kUrlBlacklist), | 115 prefs::kUrlBlacklist), |
| 116 PolicyAndPref(key::kURLWhitelist, | 116 PolicyAndPref(key::kURLWhitelist, |
| 117 prefs::kUrlWhitelist))); | 117 prefs::kUrlWhitelist))); |
| 118 | 118 |
| 119 #if defined(OS_CHROMEOS) | |
| 120 INSTANTIATE_TEST_CASE_P( | |
| 121 CrosConfigurationPolicyPrefStoreListTestInstance, | |
| 122 ConfigurationPolicyPrefStoreListTest, | |
| 123 testing::Values( | |
| 124 PolicyAndPref(key::kAttestationExtensionWhitelist, | |
| 125 prefs::kAttestationExtensionWhitelist))); | |
|
Mattias Nissler (ping if slow)
2013/04/17 08:09:09
This probably no longer passes when using the hand
davidyu
2013/04/17 08:24:19
Done.
| |
| 126 #endif // defined(OS_CHROMEOS) | |
| 127 | |
| 119 // Test cases for string-valued policy settings. | 128 // Test cases for string-valued policy settings. |
| 120 class ConfigurationPolicyPrefStoreStringTest | 129 class ConfigurationPolicyPrefStoreStringTest |
| 121 : public ConfigurationPolicyPrefStoreTest, | 130 : public ConfigurationPolicyPrefStoreTest, |
| 122 public testing::WithParamInterface<PolicyAndPref> {}; | 131 public testing::WithParamInterface<PolicyAndPref> {}; |
| 123 | 132 |
| 124 TEST_P(ConfigurationPolicyPrefStoreStringTest, GetDefault) { | 133 TEST_P(ConfigurationPolicyPrefStoreStringTest, GetDefault) { |
| 125 EXPECT_FALSE(store_->GetValue(GetParam().pref_name(), NULL)); | 134 EXPECT_FALSE(store_->GetValue(GetParam().pref_name(), NULL)); |
| 126 } | 135 } |
| 127 | 136 |
| 128 TEST_P(ConfigurationPolicyPrefStoreStringTest, SetValue) { | 137 TEST_P(ConfigurationPolicyPrefStoreStringTest, SetValue) { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 301 prefs::kDisableDrive), | 310 prefs::kDisableDrive), |
| 302 PolicyAndPref(key::kDriveDisabledOverCellular, | 311 PolicyAndPref(key::kDriveDisabledOverCellular, |
| 303 prefs::kDisableDriveOverCellular), | 312 prefs::kDisableDriveOverCellular), |
| 304 PolicyAndPref(key::kExternalStorageDisabled, | 313 PolicyAndPref(key::kExternalStorageDisabled, |
| 305 prefs::kExternalStorageDisabled), | 314 prefs::kExternalStorageDisabled), |
| 306 PolicyAndPref(key::kShowAccessibilityOptionsInSystemTrayMenu, | 315 PolicyAndPref(key::kShowAccessibilityOptionsInSystemTrayMenu, |
| 307 prefs::kShouldAlwaysShowAccessibilityMenu), | 316 prefs::kShouldAlwaysShowAccessibilityMenu), |
| 308 PolicyAndPref(key::kAudioOutputAllowed, | 317 PolicyAndPref(key::kAudioOutputAllowed, |
| 309 prefs::kAudioOutputAllowed), | 318 prefs::kAudioOutputAllowed), |
| 310 PolicyAndPref(key::kAudioCaptureAllowed, | 319 PolicyAndPref(key::kAudioCaptureAllowed, |
| 311 prefs::kAudioCaptureAllowed))); | 320 prefs::kAudioCaptureAllowed), |
| 321 PolicyAndPref(key::kAttestationEnabledForUser, | |
| 322 prefs::kAttestationEnabled))); | |
| 312 #endif // defined(OS_CHROMEOS) | 323 #endif // defined(OS_CHROMEOS) |
| 313 | 324 |
| 314 // Test cases for integer-valued policy settings. | 325 // Test cases for integer-valued policy settings. |
| 315 class ConfigurationPolicyPrefStoreIntegerTest | 326 class ConfigurationPolicyPrefStoreIntegerTest |
| 316 : public ConfigurationPolicyPrefStoreTest, | 327 : public ConfigurationPolicyPrefStoreTest, |
| 317 public testing::WithParamInterface<PolicyAndPref> {}; | 328 public testing::WithParamInterface<PolicyAndPref> {}; |
| 318 | 329 |
| 319 TEST_P(ConfigurationPolicyPrefStoreIntegerTest, GetDefault) { | 330 TEST_P(ConfigurationPolicyPrefStoreIntegerTest, GetDefault) { |
| 320 EXPECT_FALSE(store_->GetValue(GetParam().pref_name(), NULL)); | 331 EXPECT_FALSE(store_->GetValue(GetParam().pref_name(), NULL)); |
| 321 } | 332 } |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1100 policy.Set(key::kDefaultJavaScriptSetting, POLICY_LEVEL_MANDATORY, | 1111 policy.Set(key::kDefaultJavaScriptSetting, POLICY_LEVEL_MANDATORY, |
| 1101 POLICY_SCOPE_USER, | 1112 POLICY_SCOPE_USER, |
| 1102 base::Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); | 1113 base::Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); |
| 1103 UpdateProviderPolicy(policy); | 1114 UpdateProviderPolicy(policy); |
| 1104 EXPECT_TRUE(store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, | 1115 EXPECT_TRUE(store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, |
| 1105 &value)); | 1116 &value)); |
| 1106 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value)); | 1117 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value)); |
| 1107 } | 1118 } |
| 1108 | 1119 |
| 1109 } // namespace policy | 1120 } // namespace policy |
| OLD | NEW |