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

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

Issue 7057009: Convert list policy to string preference. (DefaultSearchProviderEncodings). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review, rebase 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
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 f018077b940c47644c427ec0c439881ff10fbc51..b7f77dd9ca5d94643fa7754d4639d79eca424111 100644
--- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
+++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
@@ -555,7 +555,9 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, FullyDefined) {
const char* const icon_url = "http://test.com/icon.jpg";
const char* const name = "MyName";
const char* const keyword = "MyKeyword";
- const char* const encodings = "UTF-16;UTF-8";
+ ListValue* encodings = new ListValue();
+ encodings->Append(Value::CreateStringValue("UTF-16"));
+ encodings->Append(Value::CreateStringValue("UTF-8"));
MockConfigurationPolicyProvider provider;
provider.AddPolicy(kPolicyDefaultSearchProviderEnabled,
Value::CreateBooleanValue(true));
@@ -569,8 +571,7 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, FullyDefined) {
Value::CreateStringValue(suggest_url));
provider.AddPolicy(kPolicyDefaultSearchProviderIconURL,
Value::CreateStringValue(icon_url));
- provider.AddPolicy(kPolicyDefaultSearchProviderEncodings,
- Value::CreateStringValue(encodings));
+ provider.AddPolicy(kPolicyDefaultSearchProviderEncodings, encodings);
scoped_refptr<ConfigurationPolicyPrefStore> store(
new ConfigurationPolicyPrefStore(&provider));
@@ -598,7 +599,7 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, FullyDefined) {
EXPECT_EQ(PrefStore::READ_OK,
store->GetValue(prefs::kDefaultSearchProviderEncodings, &value));
- EXPECT_TRUE(StringValue(encodings).Equals(value));
+ EXPECT_TRUE(StringValue("UTF-16;UTF-8").Equals(value));
}
// Checks that if the default search policy is missing, that no elements of the
@@ -608,7 +609,9 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, MissingUrl) {
const char* const icon_url = "http://test.com/icon.jpg";
const char* const name = "MyName";
const char* const keyword = "MyKeyword";
- const char* const encodings = "UTF-16;UTF-8";
+ ListValue* encodings = new ListValue();
+ encodings->Append(Value::CreateStringValue("UTF-16"));
+ encodings->Append(Value::CreateStringValue("UTF-8"));
MockConfigurationPolicyProvider provider;
provider.AddPolicy(kPolicyDefaultSearchProviderEnabled,
Value::CreateBooleanValue(true));
@@ -620,8 +623,7 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, MissingUrl) {
Value::CreateStringValue(suggest_url));
provider.AddPolicy(kPolicyDefaultSearchProviderIconURL,
Value::CreateStringValue(icon_url));
- provider.AddPolicy(kPolicyDefaultSearchProviderEncodings,
- Value::CreateStringValue(encodings));
+ provider.AddPolicy(kPolicyDefaultSearchProviderEncodings, encodings);
scoped_refptr<ConfigurationPolicyPrefStore> store(
new ConfigurationPolicyPrefStore(&provider));
@@ -648,7 +650,9 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, Invalid) {
const char* const icon_url = "http://test.com/icon.jpg";
const char* const name = "MyName";
const char* const keyword = "MyKeyword";
- const char* const encodings = "UTF-16;UTF-8";
+ ListValue* encodings = new ListValue();
+ encodings->Append(Value::CreateStringValue("UTF-16"));
+ encodings->Append(Value::CreateStringValue("UTF-8"));
MockConfigurationPolicyProvider provider;
provider.AddPolicy(kPolicyDefaultSearchProviderEnabled,
Value::CreateBooleanValue(true));
@@ -662,8 +666,7 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, Invalid) {
Value::CreateStringValue(suggest_url));
provider.AddPolicy(kPolicyDefaultSearchProviderIconURL,
Value::CreateStringValue(icon_url));
- provider.AddPolicy(kPolicyDefaultSearchProviderEncodings,
- Value::CreateStringValue(encodings));
+ provider.AddPolicy(kPolicyDefaultSearchProviderEncodings, encodings);
scoped_refptr<ConfigurationPolicyPrefStore> store(
new ConfigurationPolicyPrefStore(&provider));

Powered by Google App Engine
This is Rietveld 408576698