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

Unified Diff: components/policy/core/common/schema_map_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/common/schema_map_unittest.cc
diff --git a/components/policy/core/common/schema_map_unittest.cc b/components/policy/core/common/schema_map_unittest.cc
index 2d44a48229738ca28da922e7daae320a68b7444a..5913ee1cd14fa57d012b0e9856ab25505150a82a 100644
--- a/components/policy/core/common/schema_map_unittest.cc
+++ b/components/policy/core/common/schema_map_unittest.cc
@@ -142,15 +142,14 @@ TEST_F(SchemaMapTest, FilterBundle) {
PolicyNamespace chrome_ns(POLICY_DOMAIN_CHROME, "");
expected_bundle.Get(chrome_ns).Set(
"ChromePolicy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>("value"),
- nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value"), nullptr);
bundle.CopyFrom(expected_bundle);
// Unknown components are filtered out.
PolicyNamespace another_extension_ns(POLICY_DOMAIN_EXTENSIONS, "xyz");
bundle.Get(another_extension_ns)
.Set("AnotherExtensionPolicy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>("value"),
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value"),
nullptr);
schema_map->FilterBundle(&bundle);
EXPECT_TRUE(bundle.Equals(expected_bundle));
@@ -176,14 +175,13 @@ TEST_F(SchemaMapTest, FilterBundle) {
map.Set("object", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD, dict.CreateDeepCopy(), nullptr);
map.Set("string", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>("value"),
- nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value"), nullptr);
bundle.MergeFrom(expected_bundle);
bundle.Get(extension_ns)
.Set("Unexpected", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::StringValue>("to-be-removed"), nullptr);
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("to-be-removed"),
+ nullptr);
schema_map->FilterBundle(&bundle);
EXPECT_TRUE(bundle.Equals(expected_bundle));
@@ -239,15 +237,14 @@ TEST_F(SchemaMapTest, LegacyComponents) {
PolicyNamespace extension_ns(POLICY_DOMAIN_EXTENSIONS, "with-schema");
bundle.Get(extension_ns)
.Set("String", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>("value 1"),
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value 1"),
nullptr);
// The Chrome namespace isn't filtered.
PolicyNamespace chrome_ns(POLICY_DOMAIN_CHROME, "");
bundle.Get(chrome_ns).Set("ChromePolicy", POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
- base::MakeUnique<base::StringValue>("value 3"),
- nullptr);
+ base::MakeUnique<base::Value>("value 3"), nullptr);
PolicyBundle expected_bundle;
expected_bundle.MergeFrom(bundle);
@@ -256,20 +253,20 @@ TEST_F(SchemaMapTest, LegacyComponents) {
PolicyNamespace without_schema_ns(POLICY_DOMAIN_EXTENSIONS, "without-schema");
bundle.Get(without_schema_ns)
.Set("Schemaless", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>("value 2"),
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value 2"),
nullptr);
// Unknown policies of known components with a schema are removed.
bundle.Get(extension_ns)
.Set("Surprise", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>("value 4"),
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value 4"),
nullptr);
// Unknown components are removed.
PolicyNamespace unknown_ns(POLICY_DOMAIN_EXTENSIONS, "unknown");
bundle.Get(unknown_ns)
.Set("Surprise", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>("value 5"),
+ POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value 5"),
nullptr);
schema_map->FilterBundle(&bundle);

Powered by Google App Engine
This is Rietveld 408576698