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

Unified Diff: components/policy/core/common/policy_bundle_unittest.cc

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 10 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/core/common/mac_util.cc ('k') | components/policy/core/common/policy_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/policy_bundle_unittest.cc
diff --git a/components/policy/core/common/policy_bundle_unittest.cc b/components/policy/core/common/policy_bundle_unittest.cc
index 4cf59f60681dfd09d00354516e21973ede482be3..e15abc3b7086b7c3caf50d81767e0ff9013130af 100644
--- a/components/policy/core/common/policy_bundle_unittest.cc
+++ b/components/policy/core/common/policy_bundle_unittest.cc
@@ -32,14 +32,13 @@ const char kExtension3[] = "extension-3";
// Adds test policies to |policy|.
void AddTestPolicies(PolicyMap* policy) {
policy->Set("mandatory-user", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::FundamentalValue>(123), nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(123), nullptr);
policy->Set("mandatory-machine", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>("omg"),
nullptr);
policy->Set("recommended-user", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::FundamentalValue>(true), nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true),
+ nullptr);
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetBoolean("false", false);
dict->SetInteger("int", 456);
@@ -59,13 +58,13 @@ void AddTestPoliciesWithParams(PolicyMap *policy,
PolicyLevel level,
PolicyScope scope) {
policy->Set(kPolicyClashing0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::FundamentalValue>(value), nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(value),
+ nullptr);
policy->Set(kPolicyClashing1, level, scope, POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::FundamentalValue>(value), nullptr);
+ base::MakeUnique<base::Value>(value), nullptr);
policy->Set(name, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::FundamentalValue>(value), nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(value),
+ nullptr);
}
// Returns true if |bundle| is empty.
@@ -193,20 +192,15 @@ TEST(PolicyBundleTest, MergeFrom) {
// - kPolicyN are merged from each bundle.
PolicyMap expected;
expected.Set(kPolicyClashing0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::FundamentalValue>(0),
- nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0), nullptr);
expected.Set(kPolicyClashing1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::FundamentalValue>(1),
- nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(1), nullptr);
expected.Set(kPolicy0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::FundamentalValue>(0),
- nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0), nullptr);
expected.Set(kPolicy1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::FundamentalValue>(1),
- nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(1), nullptr);
expected.Set(kPolicy2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::FundamentalValue>(2),
- nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(2), nullptr);
EXPECT_TRUE(merged.Get(PolicyNamespace(POLICY_DOMAIN_CHROME,
std::string())).Equals(expected));
EXPECT_TRUE(merged.Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS,
@@ -246,15 +240,13 @@ TEST(PolicyBundleTest, Equals) {
other.CopyFrom(bundle);
bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
.Set(kPolicy0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::FundamentalValue>(123),
- nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(123), nullptr);
EXPECT_FALSE(bundle.Equals(other));
other.CopyFrom(bundle);
EXPECT_TRUE(bundle.Equals(other));
bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
.Set(kPolicy0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::FundamentalValue>(123),
- nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(123), nullptr);
EXPECT_FALSE(bundle.Equals(other));
// Test non-const Get().
@@ -264,8 +256,8 @@ TEST(PolicyBundleTest, Equals) {
bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
EXPECT_TRUE(bundle.Equals(other));
policy_map.Set(kPolicy0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::FundamentalValue>(123), nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(123),
+ nullptr);
EXPECT_FALSE(bundle.Equals(other));
}
« no previous file with comments | « components/policy/core/common/mac_util.cc ('k') | components/policy/core/common/policy_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698