Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: chrome/browser/policy/configuration_policy_pref_store_unittest.cc

Issue 10873085: Implement two new policies to control muting the audio I/O. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to ToT. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 289 PolicyAndPref(key::kExternalStorageDisabled,
290 prefs::kExternalStorageDisabled))); 290 prefs::kExternalStorageDisabled),
291 PolicyAndPref(key::kAudioOutputAllowed,
292 prefs::kAudioOutputAllowed),
293 PolicyAndPref(key::kAudioCaptureAllowed,
294 prefs::kAudioCaptureAllowed)));
291 #endif // defined(OS_CHROMEOS) 295 #endif // defined(OS_CHROMEOS)
292 296
293 // Test cases for integer-valued policy settings. 297 // Test cases for integer-valued policy settings.
294 class ConfigurationPolicyPrefStoreIntegerTest 298 class ConfigurationPolicyPrefStoreIntegerTest
295 : public ConfigurationPolicyPrefStoreTest, 299 : public ConfigurationPolicyPrefStoreTest,
296 public testing::WithParamInterface<PolicyAndPref> {}; 300 public testing::WithParamInterface<PolicyAndPref> {};
297 301
298 TEST_P(ConfigurationPolicyPrefStoreIntegerTest, GetDefault) { 302 TEST_P(ConfigurationPolicyPrefStoreIntegerTest, GetDefault) {
299 EXPECT_EQ(PrefStore::READ_NO_VALUE, 303 EXPECT_EQ(PrefStore::READ_NO_VALUE,
300 store_->GetValue(GetParam().pref_name(), NULL)); 304 store_->GetValue(GetParam().pref_name(), NULL));
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 policy.Set(key::kDefaultJavaScriptSetting, POLICY_LEVEL_MANDATORY, 1071 policy.Set(key::kDefaultJavaScriptSetting, POLICY_LEVEL_MANDATORY,
1068 POLICY_SCOPE_USER, 1072 POLICY_SCOPE_USER,
1069 base::Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); 1073 base::Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
1070 provider_.UpdateChromePolicy(policy); 1074 provider_.UpdateChromePolicy(policy);
1071 EXPECT_EQ(PrefStore::READ_OK, 1075 EXPECT_EQ(PrefStore::READ_OK,
1072 store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, &value)); 1076 store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, &value));
1073 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value)); 1077 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value));
1074 } 1078 }
1075 1079
1076 } // namespace policy 1080 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698