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

Unified Diff: components/policy/core/browser/proxy_policy_handler_unittest.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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: components/policy/core/browser/proxy_policy_handler_unittest.cc
diff --git a/components/policy/core/browser/proxy_policy_handler_unittest.cc b/components/policy/core/browser/proxy_policy_handler_unittest.cc
index 9f261da3d729a1157cf725a24922577f2baf00da..6a70b7fb4c16aa2d5b91c02d062e02413c1c9b1c 100644
--- a/components/policy/core/browser/proxy_policy_handler_unittest.cc
+++ b/components/policy/core/browser/proxy_policy_handler_unittest.cc
@@ -77,12 +77,12 @@ class ProxyPolicyHandlerTest
TEST_F(ProxyPolicyHandlerTest, ManualOptions) {
PolicyMap policy;
policy.Set(key::kProxyBypassList, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(
- "http://chromium.org/override"),
+ POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::Value>("http://chromium.org/override"),
nullptr);
policy.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::StringValue>("chromium.org"), nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("chromium.org"),
+ nullptr);
policy.Set(
key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
@@ -106,12 +106,12 @@ TEST_F(ProxyPolicyHandlerTest, ManualOptionsReversedApplyOrder) {
ProxyPolicyHandler::PROXY_MANUALLY_CONFIGURED_PROXY_SERVER_MODE),
nullptr);
policy.Set(key::kProxyBypassList, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(
- "http://chromium.org/override"),
+ POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::Value>("http://chromium.org/override"),
nullptr);
policy.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::StringValue>("chromium.org"), nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("chromium.org"),
+ nullptr);
UpdateProviderPolicy(policy);
VerifyProxyPrefs("chromium.org",
@@ -149,8 +149,8 @@ TEST_F(ProxyPolicyHandlerTest, NoProxyServerMode) {
TEST_F(ProxyPolicyHandlerTest, NoProxyModeName) {
PolicyMap policy;
policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(
- ProxyPrefs::kDirectProxyModeName),
+ POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::Value>(ProxyPrefs::kDirectProxyModeName),
nullptr);
UpdateProviderPolicy(policy);
VerifyProxyPrefs(
@@ -173,10 +173,11 @@ TEST_F(ProxyPolicyHandlerTest, AutoDetectProxyServerMode) {
TEST_F(ProxyPolicyHandlerTest, AutoDetectProxyModeName) {
PolicyMap policy;
- policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(
- ProxyPrefs::kAutoDetectProxyModeName),
- nullptr);
+ policy.Set(
+ key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::Value>(ProxyPrefs::kAutoDetectProxyModeName),
+ nullptr);
UpdateProviderPolicy(policy);
VerifyProxyPrefs(std::string(),
std::string(),
@@ -188,11 +189,11 @@ TEST_F(ProxyPolicyHandlerTest, PacScriptProxyMode) {
PolicyMap policy;
policy.Set(key::kProxyPacUrl, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::StringValue>("http://short.org/proxy.pac"),
+ base::MakeUnique<base::Value>("http://short.org/proxy.pac"),
nullptr);
policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(
- ProxyPrefs::kPacScriptProxyModeName),
+ POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::Value>(ProxyPrefs::kPacScriptProxyModeName),
nullptr);
UpdateProviderPolicy(policy);
VerifyProxyPrefs(std::string(),
@@ -204,8 +205,8 @@ TEST_F(ProxyPolicyHandlerTest, PacScriptProxyMode) {
TEST_F(ProxyPolicyHandlerTest, PacScriptProxyModeInvalid) {
PolicyMap policy;
policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(
- ProxyPrefs::kPacScriptProxyModeName),
+ POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::Value>(ProxyPrefs::kPacScriptProxyModeName),
NULL);
UpdateProviderPolicy(policy);
const base::Value* value = NULL;
@@ -218,16 +219,16 @@ TEST_F(ProxyPolicyHandlerTest, PacScriptProxyModeBug78016) {
PolicyMap policy;
policy.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
- base::WrapUnique(new base::StringValue(std::string())), nullptr);
+ base::WrapUnique(new base::Value(std::string())), nullptr);
+ policy.Set(key::kProxyPacUrl, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
+ base::WrapUnique(new base::Value("http://short.org/proxy.pac")),
+ nullptr);
policy.Set(
- key::kProxyPacUrl, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
- base::WrapUnique(new base::StringValue("http://short.org/proxy.pac")),
+ base::WrapUnique(new base::Value(ProxyPrefs::kPacScriptProxyModeName)),
nullptr);
- policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::WrapUnique(new base::StringValue(
- ProxyPrefs::kPacScriptProxyModeName)),
- nullptr);
UpdateProviderPolicy(policy);
VerifyProxyPrefs(std::string(),
"http://short.org/proxy.pac",
@@ -250,8 +251,8 @@ TEST_F(ProxyPolicyHandlerTest, UseSystemProxyServerMode) {
TEST_F(ProxyPolicyHandlerTest, UseSystemProxyMode) {
PolicyMap policy;
policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(
- ProxyPrefs::kSystemProxyModeName),
+ POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::Value>(ProxyPrefs::kSystemProxyModeName),
nullptr);
UpdateProviderPolicy(policy);
VerifyProxyPrefs(
@@ -266,10 +267,11 @@ TEST_F(ProxyPolicyHandlerTest,
POLICY_SOURCE_CLOUD,
base::MakeUnique<base::Value>(ProxyPolicyHandler::PROXY_SERVER_MODE),
nullptr);
- policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(
- ProxyPrefs::kAutoDetectProxyModeName),
- nullptr);
+ policy.Set(
+ key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::Value>(ProxyPrefs::kAutoDetectProxyModeName),
+ nullptr);
UpdateProviderPolicy(policy);
VerifyProxyPrefs(std::string(),
std::string(),
@@ -282,15 +284,15 @@ TEST_F(ProxyPolicyHandlerTest, ProxyInvalid) {
PolicyMap policy;
policy.Set(key::kProxyPacUrl, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::StringValue>("http://short.org/proxy.pac"),
+ base::MakeUnique<base::Value>("http://short.org/proxy.pac"),
nullptr);
policy.Set(key::kProxyBypassList, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(
- "http://chromium.org/override"),
+ POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::Value>("http://chromium.org/override"),
nullptr);
policy.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::StringValue>("chromium.org"), nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("chromium.org"),
+ nullptr);
for (int i = 0; i < ProxyPolicyHandler::MODE_COUNT; ++i) {
policy.Set(key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(i), nullptr);

Powered by Google App Engine
This is Rietveld 408576698