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

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

Issue 1350913006: Revert of Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: components/policy/core/browser/configuration_policy_handler_unittest.cc
diff --git a/components/policy/core/browser/configuration_policy_handler_unittest.cc b/components/policy/core/browser/configuration_policy_handler_unittest.cc
index 57db6d6fedd76d3e59cc836f2bd940cf9ebe49d9..67b66049ae9f090344caeeefb58c2d1cad61c856 100644
--- a/components/policy/core/browser/configuration_policy_handler_unittest.cc
+++ b/components/policy/core/browser/configuration_policy_handler_unittest.cc
@@ -11,7 +11,6 @@
#include "components/policy/core/browser/configuration_policy_handler.h"
#include "components/policy/core/browser/policy_error_map.h"
#include "components/policy/core/common/policy_map.h"
-#include "components/policy/core/common/policy_types.h"
#include "components/policy/core/common/schema.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -57,22 +56,22 @@
kTestPref,
base::Bind(GetIntegerTypeMap));
- policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, list.DeepCopy(), nullptr);
+ policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, list.DeepCopy(), NULL);
errors.Clear();
EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
EXPECT_TRUE(errors.empty());
list.AppendString("one");
- policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, list.DeepCopy(), nullptr);
+ policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, list.DeepCopy(), NULL);
errors.Clear();
EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
EXPECT_TRUE(errors.empty());
list.AppendString("invalid");
- policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, list.DeepCopy(), nullptr);
+ policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, list.DeepCopy(), NULL);
errors.Clear();
EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
EXPECT_FALSE(errors.empty());
@@ -81,7 +80,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::StringValue("no list"),
NULL);
errors.Clear();
@@ -101,23 +99,23 @@
kTestPref,
base::Bind(GetIntegerTypeMap));
- policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, list.DeepCopy(), nullptr);
+ policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, list.DeepCopy(), NULL);
handler.ApplyPolicySettings(policy_map, &prefs);
EXPECT_TRUE(prefs.GetValue(kTestPref, &value));
EXPECT_TRUE(base::Value::Equals(&expected, value));
list.AppendString("two");
expected.AppendInteger(2);
- policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, list.DeepCopy(), nullptr);
+ policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, list.DeepCopy(), NULL);
handler.ApplyPolicySettings(policy_map, &prefs);
EXPECT_TRUE(prefs.GetValue(kTestPref, &value));
EXPECT_TRUE(base::Value::Equals(&expected, value));
list.AppendString("invalid");
- policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, list.DeepCopy(), nullptr);
+ policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, list.DeepCopy(), NULL);
handler.ApplyPolicySettings(policy_map, &prefs);
EXPECT_TRUE(prefs.GetValue(kTestPref, &value));
EXPECT_TRUE(base::Value::Equals(&expected, value));
@@ -135,7 +133,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(0),
NULL);
errors.Clear();
@@ -145,7 +142,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(5),
NULL);
errors.Clear();
@@ -155,7 +151,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(10),
NULL);
errors.Clear();
@@ -167,7 +162,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(-5),
NULL);
errors.Clear();
@@ -177,7 +171,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(15),
NULL);
errors.Clear();
@@ -189,7 +182,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::StringValue("invalid"),
NULL);
errors.Clear();
@@ -209,7 +201,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(0),
NULL);
errors.Clear();
@@ -219,7 +210,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(5),
NULL);
errors.Clear();
@@ -229,7 +219,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(10),
NULL);
errors.Clear();
@@ -241,7 +230,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(-5),
NULL);
errors.Clear();
@@ -251,7 +239,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(15),
NULL);
errors.Clear();
@@ -263,7 +250,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::StringValue("invalid"),
NULL);
errors.Clear();
@@ -285,7 +271,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(0),
NULL);
prefs.Clear();
@@ -297,7 +282,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(5),
NULL);
prefs.Clear();
@@ -309,7 +293,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(10),
NULL);
prefs.Clear();
@@ -323,7 +306,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(-5),
NULL);
prefs.Clear();
@@ -335,7 +317,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(15),
NULL);
prefs.Clear();
@@ -359,7 +340,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(0),
NULL);
prefs.Clear();
@@ -371,7 +351,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(5),
NULL);
prefs.Clear();
@@ -383,7 +362,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(10),
NULL);
prefs.Clear();
@@ -406,7 +384,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(0),
NULL);
errors.Clear();
@@ -416,7 +393,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(5),
NULL);
errors.Clear();
@@ -426,7 +402,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(10),
NULL);
errors.Clear();
@@ -438,7 +413,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(-5),
NULL);
errors.Clear();
@@ -448,7 +422,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(15),
NULL);
errors.Clear();
@@ -460,7 +433,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::StringValue("invalid"),
NULL);
errors.Clear();
@@ -481,7 +453,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(0),
NULL);
errors.Clear();
@@ -491,7 +462,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(5),
NULL);
errors.Clear();
@@ -501,7 +471,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(10),
NULL);
errors.Clear();
@@ -513,7 +482,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(-5),
NULL);
errors.Clear();
@@ -523,7 +491,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(15),
NULL);
errors.Clear();
@@ -535,7 +502,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::StringValue("invalid"),
NULL);
errors.Clear();
@@ -558,7 +524,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(0),
NULL);
prefs.Clear();
@@ -570,7 +535,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(5),
NULL);
prefs.Clear();
@@ -582,7 +546,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(10),
NULL);
prefs.Clear();
@@ -596,7 +559,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(-5),
NULL);
prefs.Clear();
@@ -608,7 +570,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(15),
NULL);
prefs.Clear();
@@ -633,7 +594,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(0),
NULL);
prefs.Clear();
@@ -645,7 +605,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(5),
NULL);
prefs.Clear();
@@ -657,7 +616,6 @@
policy_map.Set(kTestPolicy,
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
new base::FundamentalValue(10),
NULL);
prefs.Clear();
@@ -703,8 +661,8 @@
ASSERT_TRUE(policy_map_value->GetAsDictionary(&policy_map_dict));
PolicyMap policy_map;
- policy_map.LoadFrom(policy_map_dict, POLICY_LEVEL_RECOMMENDED,
- POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD);
+ policy_map.LoadFrom(
+ policy_map_dict, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER);
TestSchemaValidatingPolicyHandler handler(schema, SCHEMA_ALLOW_INVALID);
scoped_ptr<base::Value> output_value;
@@ -764,13 +722,11 @@
PolicyMap policy_map_recommended;
policy_map_recommended.LoadFrom(
- policy_map_dict, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD);
+ policy_map_dict, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER);
PolicyMap policy_map_mandatory;
policy_map_mandatory.LoadFrom(
- policy_map_dict, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD);
+ policy_map_dict, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER);
SimpleSchemaValidatingPolicyHandler handler_all(
policy_name,

Powered by Google App Engine
This is Rietveld 408576698