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/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "chrome/browser/policy/configuration_policy_handler.h" | 9 #include "chrome/browser/policy/configuration_policy_handler.h" |
10 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 10 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 #if defined(OS_CHROMEOS) | 278 #if defined(OS_CHROMEOS) |
279 INSTANTIATE_TEST_CASE_P( | 279 INSTANTIATE_TEST_CASE_P( |
280 CrosConfigurationPolicyPrefStoreBooleanTestInstance, | 280 CrosConfigurationPolicyPrefStoreBooleanTestInstance, |
281 ConfigurationPolicyPrefStoreBooleanTest, | 281 ConfigurationPolicyPrefStoreBooleanTest, |
282 testing::Values( | 282 testing::Values( |
283 PolicyAndPref(key::kChromeOsLockOnIdleSuspend, | 283 PolicyAndPref(key::kChromeOsLockOnIdleSuspend, |
284 prefs::kEnableScreenLock), | 284 prefs::kEnableScreenLock), |
285 PolicyAndPref(key::kGDataDisabled, | 285 PolicyAndPref(key::kGDataDisabled, |
286 prefs::kDisableGData), | 286 prefs::kDisableGData), |
287 PolicyAndPref(key::kGDataDisabledOverCellular, | 287 PolicyAndPref(key::kGDataDisabledOverCellular, |
288 prefs::kDisableGDataOverCellular))); | 288 prefs::kDisableGDataOverCellular), |
| 289 PolicyAndPref(key::kExternalStorageDisabled, |
| 290 prefs::kExternalStorageDisabled))); |
289 #endif // defined(OS_CHROMEOS) | 291 #endif // defined(OS_CHROMEOS) |
290 | 292 |
291 // Test cases for integer-valued policy settings. | 293 // Test cases for integer-valued policy settings. |
292 class ConfigurationPolicyPrefStoreIntegerTest | 294 class ConfigurationPolicyPrefStoreIntegerTest |
293 : public ConfigurationPolicyPrefStoreTest, | 295 : public ConfigurationPolicyPrefStoreTest, |
294 public testing::WithParamInterface<PolicyAndPref> {}; | 296 public testing::WithParamInterface<PolicyAndPref> {}; |
295 | 297 |
296 TEST_P(ConfigurationPolicyPrefStoreIntegerTest, GetDefault) { | 298 TEST_P(ConfigurationPolicyPrefStoreIntegerTest, GetDefault) { |
297 EXPECT_EQ(PrefStore::READ_NO_VALUE, | 299 EXPECT_EQ(PrefStore::READ_NO_VALUE, |
298 store_->GetValue(GetParam().pref_name(), NULL)); | 300 store_->GetValue(GetParam().pref_name(), NULL)); |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 policy.Set(key::kDefaultJavaScriptSetting, POLICY_LEVEL_MANDATORY, | 1067 policy.Set(key::kDefaultJavaScriptSetting, POLICY_LEVEL_MANDATORY, |
1066 POLICY_SCOPE_USER, | 1068 POLICY_SCOPE_USER, |
1067 base::Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); | 1069 base::Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); |
1068 provider_.UpdateChromePolicy(policy); | 1070 provider_.UpdateChromePolicy(policy); |
1069 EXPECT_EQ(PrefStore::READ_OK, | 1071 EXPECT_EQ(PrefStore::READ_OK, |
1070 store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, &value)); | 1072 store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, &value)); |
1071 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value)); | 1073 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value)); |
1072 } | 1074 } |
1073 | 1075 |
1074 } // namespace policy | 1076 } // namespace policy |
OLD | NEW |