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

Unified Diff: components/search_engines/default_search_policy_handler_unittest.cc

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed another test. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/policy_strings.grdp ('k') | components/sync_driver/sync_policy_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « components/policy_strings.grdp ('k') | components/sync_driver/sync_policy_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698