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

Unified Diff: chrome/browser/net/proxy_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
Index: chrome/browser/net/proxy_policy_handler_unittest.cc
diff --git a/chrome/browser/net/proxy_policy_handler_unittest.cc b/chrome/browser/net/proxy_policy_handler_unittest.cc
index 570bf01dc45a97169b7ada77ea17aa8f20d4b135..823101b348b1fa2ccb0d6a74227a4d5004d43538 100644
--- a/chrome/browser/net/proxy_policy_handler_unittest.cc
+++ b/chrome/browser/net/proxy_policy_handler_unittest.cc
@@ -10,6 +10,7 @@
#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_service_impl.h"
+#include "components/policy/core/common/policy_types.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "components/proxy_config/proxy_config_pref_names.h"
#include "policy/policy_constants.h"
@@ -76,17 +77,20 @@ TEST_F(ProxyPolicyHandlerTest, ManualOptions) {
policy.Set(key::kProxyBypassList,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue("http://chromium.org/override"),
NULL);
policy.Set(key::kProxyServer,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue("chromium.org"),
NULL);
policy.Set(
key::kProxyServerMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::FundamentalValue(
ProxyPolicyHandler::PROXY_MANUALLY_CONFIGURED_PROXY_SERVER_MODE),
NULL);
@@ -104,17 +108,20 @@ TEST_F(ProxyPolicyHandlerTest, ManualOptionsReversedApplyOrder) {
key::kProxyServerMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::FundamentalValue(
ProxyPolicyHandler::PROXY_MANUALLY_CONFIGURED_PROXY_SERVER_MODE),
NULL);
policy.Set(key::kProxyBypassList,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue("http://chromium.org/override"),
NULL);
policy.Set(key::kProxyServer,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue("chromium.org"),
NULL);
UpdateProviderPolicy(policy);
@@ -131,6 +138,7 @@ TEST_F(ProxyPolicyHandlerTest, ManualOptionsInvalid) {
key::kProxyServerMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::FundamentalValue(
ProxyPolicyHandler::PROXY_MANUALLY_CONFIGURED_PROXY_SERVER_MODE),
NULL);
@@ -145,6 +153,7 @@ TEST_F(ProxyPolicyHandlerTest, NoProxyServerMode) {
policy.Set(key::kProxyServerMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::FundamentalValue(ProxyPolicyHandler::PROXY_SERVER_MODE),
NULL);
UpdateProviderPolicy(policy);
@@ -157,6 +166,7 @@ TEST_F(ProxyPolicyHandlerTest, NoProxyModeName) {
policy.Set(key::kProxyMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue(ProxyPrefs::kDirectProxyModeName),
NULL);
UpdateProviderPolicy(policy);
@@ -169,6 +179,7 @@ TEST_F(ProxyPolicyHandlerTest, AutoDetectProxyServerMode) {
policy.Set(key::kProxyServerMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::FundamentalValue(
ProxyPolicyHandler::PROXY_AUTO_DETECT_PROXY_SERVER_MODE),
NULL);
@@ -184,6 +195,7 @@ TEST_F(ProxyPolicyHandlerTest, AutoDetectProxyModeName) {
policy.Set(key::kProxyMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue(ProxyPrefs::kAutoDetectProxyModeName),
NULL);
UpdateProviderPolicy(policy);
@@ -198,11 +210,13 @@ TEST_F(ProxyPolicyHandlerTest, PacScriptProxyMode) {
policy.Set(key::kProxyPacUrl,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue("http://short.org/proxy.pac"),
NULL);
policy.Set(key::kProxyMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue(ProxyPrefs::kPacScriptProxyModeName),
NULL);
UpdateProviderPolicy(policy);
@@ -217,6 +231,7 @@ TEST_F(ProxyPolicyHandlerTest, PacScriptProxyModeInvalid) {
policy.Set(key::kProxyMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue(ProxyPrefs::kPacScriptProxyModeName),
NULL);
UpdateProviderPolicy(policy);
@@ -231,16 +246,19 @@ TEST_F(ProxyPolicyHandlerTest, PacScriptProxyModeBug78016) {
policy.Set(key::kProxyServer,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue(std::string()),
NULL);
policy.Set(key::kProxyPacUrl,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue("http://short.org/proxy.pac"),
NULL);
policy.Set(key::kProxyMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue(ProxyPrefs::kPacScriptProxyModeName),
NULL);
UpdateProviderPolicy(policy);
@@ -255,6 +273,7 @@ TEST_F(ProxyPolicyHandlerTest, UseSystemProxyServerMode) {
policy.Set(key::kProxyServerMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::FundamentalValue(
ProxyPolicyHandler::PROXY_USE_SYSTEM_PROXY_SERVER_MODE),
NULL);
@@ -268,6 +287,7 @@ TEST_F(ProxyPolicyHandlerTest, UseSystemProxyMode) {
policy.Set(key::kProxyMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue(ProxyPrefs::kSystemProxyModeName),
NULL);
UpdateProviderPolicy(policy);
@@ -281,11 +301,13 @@ TEST_F(ProxyPolicyHandlerTest,
policy.Set(key::kProxyServerMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::FundamentalValue(ProxyPolicyHandler::PROXY_SERVER_MODE),
NULL);
policy.Set(key::kProxyMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue(ProxyPrefs::kAutoDetectProxyModeName),
NULL);
UpdateProviderPolicy(policy);
@@ -301,22 +323,26 @@ TEST_F(ProxyPolicyHandlerTest, ProxyInvalid) {
policy.Set(key::kProxyPacUrl,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue("http://short.org/proxy.pac"),
NULL);
policy.Set(key::kProxyBypassList,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue("http://chromium.org/override"),
NULL);
policy.Set(key::kProxyServer,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::StringValue("chromium.org"),
NULL);
for (int i = 0; i < ProxyPolicyHandler::MODE_COUNT; ++i) {
policy.Set(key::kProxyServerMode,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
new base::FundamentalValue(i),
NULL);
UpdateProviderPolicy(policy);
« no previous file with comments | « chrome/browser/net/disk_cache_dir_policy_handler_unittest.cc ('k') | chrome/browser/policy/cloud/cloud_policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698