Index: components/search_engines/default_search_policy_handler_unittest.cc |
diff --git a/components/search_engines/default_search_policy_handler_unittest.cc b/components/search_engines/default_search_policy_handler_unittest.cc |
index 954984be3a0fd6385bfaad42ebb39841227461f7..c4fdea213f890930d25211d71637daac03a569c4 100644 |
--- a/components/search_engines/default_search_policy_handler_unittest.cc |
+++ b/components/search_engines/default_search_policy_handler_unittest.cc |
@@ -5,6 +5,7 @@ |
#include "base/memory/scoped_ptr.h" |
#include "components/policy/core/browser/configuration_policy_pref_store.h" |
#include "components/policy/core/browser/configuration_policy_pref_store_test.h" |
+#include "components/policy/core/common/policy_types.h" |
#include "components/search_engines/default_search_manager.h" |
#include "components/search_engines/default_search_policy_handler.h" |
#include "components/search_engines/search_engines_pref_names.h" |
@@ -85,55 +86,66 @@ void DefaultSearchPolicyHandlerTest:: |
policy->Set(key::kDefaultSearchProviderEnabled, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::FundamentalValue(true), |
NULL); |
policy->Set(key::kDefaultSearchProviderSearchURL, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kSearchURL), |
NULL); |
policy->Set(key::kDefaultSearchProviderName, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kName), |
NULL); |
policy->Set(key::kDefaultSearchProviderKeyword, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kKeyword), |
NULL); |
policy->Set(key::kDefaultSearchProviderSuggestURL, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kSuggestURL), |
NULL); |
policy->Set(key::kDefaultSearchProviderIconURL, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kIconURL), |
NULL); |
policy->Set(key::kDefaultSearchProviderEncodings, POLICY_LEVEL_MANDATORY, |
- POLICY_SCOPE_USER, encodings, NULL); |
+ POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, encodings, nullptr); |
policy->Set(key::kDefaultSearchProviderAlternateURLs, POLICY_LEVEL_MANDATORY, |
- POLICY_SCOPE_USER, default_alternate_urls_.DeepCopy(), NULL); |
+ POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
+ default_alternate_urls_.DeepCopy(), nullptr); |
policy->Set(key::kDefaultSearchProviderSearchTermsReplacementKey, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kReplacementKey), |
NULL); |
policy->Set(key::kDefaultSearchProviderImageURL, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kImageURL), |
NULL); |
policy->Set(key::kDefaultSearchProviderImageURLPostParams, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kImageParams), |
NULL); |
policy->Set(key::kDefaultSearchProviderNewTabURL, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kNewTabURL), |
NULL); |
} |
@@ -157,7 +169,8 @@ TEST_F(DefaultSearchPolicyHandlerTest, Invalid) { |
BuildDefaultSearchPolicy(&policy); |
const char bad_search_url[] = "http://test.com/noSearchTerms"; |
policy.Set(key::kDefaultSearchProviderSearchURL, POLICY_LEVEL_MANDATORY, |
- POLICY_SCOPE_USER, new base::StringValue(bad_search_url), NULL); |
+ POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
+ new base::StringValue(bad_search_url), nullptr); |
UpdateProviderPolicy(policy); |
const base::Value* temp = nullptr; |
@@ -234,6 +247,7 @@ TEST_F(DefaultSearchPolicyHandlerTest, Disabled) { |
policy.Set(key::kDefaultSearchProviderEnabled, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::FundamentalValue(false), |
NULL); |
UpdateProviderPolicy(policy); |
@@ -254,11 +268,13 @@ TEST_F(DefaultSearchPolicyHandlerTest, MinimallyDefined) { |
policy.Set(key::kDefaultSearchProviderEnabled, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::FundamentalValue(true), |
NULL); |
policy.Set(key::kDefaultSearchProviderSearchURL, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kSearchURL), |
NULL); |
UpdateProviderPolicy(policy); |
@@ -316,11 +332,13 @@ TEST_F(DefaultSearchPolicyHandlerTest, FileURL) { |
policy.Set(key::kDefaultSearchProviderEnabled, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::FundamentalValue(true), |
NULL); |
policy.Set(key::kDefaultSearchProviderSearchURL, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kFileSearchURL), |
NULL); |
UpdateProviderPolicy(policy); |