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

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

Issue 11552020: Add search_terms_replacement_key field to TemplateURL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed logic to check search_terms_replacement_key in template_url.cc. This is for a next CL. Created 8 years 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 ccd9a05d284d5285ad1748cddf11895a21598812..0600465d5c5a01be17a83e7fd3f68439f915aea2 100644
--- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
+++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
@@ -567,6 +567,7 @@ class ConfigurationPolicyPrefStoreDefaultSearchTest
static const char* const kIconURL;
static const char* const kName;
static const char* const kKeyword;
+ static const char* const kReplacementKey;
// Build a default search policy by setting search-related keys in |policy| to
// reasonable values. You can update any of the keys after calling this
@@ -586,6 +587,8 @@ const char* const ConfigurationPolicyPrefStoreDefaultSearchTest::kName =
"MyName";
const char* const ConfigurationPolicyPrefStoreDefaultSearchTest::kKeyword =
"MyKeyword";
+const char* const
+ ConfigurationPolicyPrefStoreDefaultSearchTest::kReplacementKey = "espv";
void ConfigurationPolicyPrefStoreDefaultSearchTest::
BuildDefaultSearchPolicy(PolicyMap* policy) {
@@ -608,6 +611,9 @@ void ConfigurationPolicyPrefStoreDefaultSearchTest::
POLICY_SCOPE_USER, encodings);
policy->Set(key::kDefaultSearchProviderAlternateURLs, POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER, default_alternate_urls_.DeepCopy());
+ policy->Set(key::kDefaultSearchProviderSearchTermsReplacementKey,
+ POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ base::Value::CreateStringValue(kReplacementKey));
}
// Checks that if the policy for default search is valid, i.e. there's a
@@ -647,6 +653,11 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, MinimallyDefined) {
EXPECT_TRUE(store_->GetValue(prefs::kDefaultSearchProviderAlternateURLs,
&value));
EXPECT_TRUE(base::ListValue().Equals(value));
+
+ EXPECT_TRUE(
+ store_->GetValue(prefs::kDefaultSearchProviderSearchTermsReplacementKey,
+ &value));
+ EXPECT_TRUE(base::StringValue(std::string()).Equals(value));
}
// Checks that for a fully defined search policy, all elements have been
@@ -679,6 +690,11 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, FullyDefined) {
EXPECT_TRUE(store_->GetValue(
prefs::kDefaultSearchProviderAlternateURLs, &value));
EXPECT_TRUE(default_alternate_urls_.Equals(value));
+
+ EXPECT_TRUE(
+ store_->GetValue(prefs::kDefaultSearchProviderSearchTermsReplacementKey,
+ &value));
+ EXPECT_TRUE(base::StringValue(kReplacementKey).Equals(value));
}
// Checks that if the default search policy is missing, that no elements of the
@@ -697,6 +713,8 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, MissingUrl) {
EXPECT_FALSE(store_->GetValue(prefs::kDefaultSearchProviderEncodings, NULL));
EXPECT_FALSE(store_->GetValue(prefs::kDefaultSearchProviderAlternateURLs,
NULL));
+ EXPECT_FALSE(store_->GetValue(
+ prefs::kDefaultSearchProviderSearchTermsReplacementKey, NULL));
}
// Checks that if the default search policy is invalid, that no elements of the
@@ -718,6 +736,8 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, Invalid) {
EXPECT_FALSE(store_->GetValue(prefs::kDefaultSearchProviderEncodings, NULL));
EXPECT_FALSE(store_->GetValue(prefs::kDefaultSearchProviderAlternateURLs,
NULL));
+ EXPECT_FALSE(store_->GetValue(
+ prefs::kDefaultSearchProviderSearchTermsReplacementKey, NULL));
}
// Checks that if the default search policy is invalid, that no elements of the

Powered by Google App Engine
This is Rietveld 408576698