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

Unified Diff: chrome/browser/policy/configuration_policy_pref_store_unittest.cc

Issue 7096013: Allow device policy code to be optionally included. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make changes requested by torne. Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/configuration_policy_pref_store.cc ('k') | chrome/browser/policy/policy_stubs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/configuration_policy_pref_store_unittest.cc
diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
index 1b650957d07c97c675e0493221ee7ce7683e47ce..6b9ada0190738ce28b0381551e91f2f5e0ea1b6d 100644
--- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
+++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
@@ -38,7 +38,7 @@ class ConfigurationPolicyPrefStoreTestBase : public TESTBASE {
protected:
ConfigurationPolicyPrefStoreTestBase()
: provider_(),
- store_(new ConfigurationPolicyPrefStore(&provider_)) {}
+ store_(ConfigurationPolicyPrefStore::Create(&provider_)) {}
MockConfigurationPolicyProvider provider_;
scoped_refptr<ConfigurationPolicyPrefStore> store_;
@@ -326,7 +326,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, ManualOptions) {
kPolicyManuallyConfiguredProxyServerMode));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
VerifyProxyPrefs(
*store, "chromium.org", "", "http://chromium.org/override",
ProxyPrefs::MODE_FIXED_SERVERS);
@@ -342,7 +342,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, ManualOptionsReversedApplyOrder) {
provider.AddPolicy(kPolicyProxyServer,
Value::CreateStringValue("chromium.org"));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
VerifyProxyPrefs(
*store, "chromium.org", "", "http://chromium.org/override",
ProxyPrefs::MODE_FIXED_SERVERS);
@@ -355,7 +355,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, ManualOptionsInvalid) {
kPolicyManuallyConfiguredProxyServerMode));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
const Value* value = NULL;
EXPECT_EQ(PrefStore::READ_NO_VALUE, store->GetValue(prefs::kProxy, &value));
}
@@ -367,7 +367,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, NoProxyServerMode) {
Value::CreateIntegerValue(kPolicyNoProxyServerMode));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
VerifyProxyPrefs(*store, "", "", "", ProxyPrefs::MODE_DIRECT);
}
@@ -378,7 +378,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, NoProxyModeName) {
Value::CreateStringValue(ProxyPrefs::kDirectProxyModeName));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
VerifyProxyPrefs(*store, "", "", "", ProxyPrefs::MODE_DIRECT);
}
@@ -389,7 +389,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectProxyServerMode) {
Value::CreateIntegerValue(kPolicyAutoDetectProxyServerMode));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
VerifyProxyPrefs(*store, "", "", "", ProxyPrefs::MODE_AUTO_DETECT);
}
@@ -400,7 +400,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectProxyModeName) {
Value::CreateStringValue(ProxyPrefs::kAutoDetectProxyModeName));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
VerifyProxyPrefs(*store, "", "", "", ProxyPrefs::MODE_AUTO_DETECT);
}
@@ -413,7 +413,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, PacScriptProxyMode) {
Value::CreateStringValue(ProxyPrefs::kPacScriptProxyModeName));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
VerifyProxyPrefs(*store, "", "http://short.org/proxy.pac", "",
ProxyPrefs::MODE_PAC_SCRIPT);
}
@@ -425,7 +425,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, PacScriptProxyModeInvalid) {
Value::CreateStringValue(ProxyPrefs::kPacScriptProxyModeName));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
const Value* value = NULL;
EXPECT_EQ(PrefStore::READ_NO_VALUE, store->GetValue(prefs::kProxy, &value));
}
@@ -443,7 +443,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, PacScriptProxyModeBug78016) {
Value::CreateStringValue(ProxyPrefs::kPacScriptProxyModeName));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
VerifyProxyPrefs(*store, "", "http://short.org/proxy.pac", "",
ProxyPrefs::MODE_PAC_SCRIPT);
}
@@ -455,7 +455,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, UseSystemProxyServerMode) {
Value::CreateIntegerValue(kPolicyUseSystemProxyServerMode));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
VerifyProxyPrefs(*store, "", "", "", ProxyPrefs::MODE_SYSTEM);
}
@@ -466,7 +466,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, UseSystemProxyMode) {
Value::CreateStringValue(ProxyPrefs::kSystemProxyModeName));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
VerifyProxyPrefs(*store, "", "", "", ProxyPrefs::MODE_SYSTEM);
}
@@ -480,7 +480,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest,
Value::CreateStringValue(ProxyPrefs::kAutoDetectProxyModeName));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
VerifyProxyPrefs(*store, "", "", "", ProxyPrefs::MODE_AUTO_DETECT);
}
@@ -498,7 +498,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, ProxyInvalid) {
Value::CreateStringValue("chromium.org"));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
const Value* value = NULL;
EXPECT_EQ(PrefStore::READ_NO_VALUE,
store->GetValue(prefs::kProxy, &value));
@@ -519,7 +519,7 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, MinimallyDefined) {
Value::CreateStringValue(search_url));
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
const Value* value = NULL;
EXPECT_EQ(PrefStore::READ_OK,
@@ -578,7 +578,7 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, FullyDefined) {
provider.AddPolicy(kPolicyDefaultSearchProviderEncodings, encodings);
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
const Value* value = NULL;
EXPECT_EQ(PrefStore::READ_OK,
@@ -630,7 +630,7 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, MissingUrl) {
provider.AddPolicy(kPolicyDefaultSearchProviderEncodings, encodings);
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
EXPECT_EQ(PrefStore::READ_NO_VALUE,
store->GetValue(prefs::kDefaultSearchProviderSearchURL, NULL));
@@ -673,7 +673,7 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, Invalid) {
provider.AddPolicy(kPolicyDefaultSearchProviderEncodings, encodings);
scoped_refptr<ConfigurationPolicyPrefStore> store(
- new ConfigurationPolicyPrefStore(&provider));
+ ConfigurationPolicyPrefStore::Create(&provider));
EXPECT_EQ(PrefStore::READ_NO_VALUE,
store->GetValue(prefs::kDefaultSearchProviderSearchURL, NULL));
« no previous file with comments | « chrome/browser/policy/configuration_policy_pref_store.cc ('k') | chrome/browser/policy/policy_stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698