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

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

Issue 388963002: Get rid of the rest of CreateStringValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tweaks Created 6 years, 5 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 e0eb089ab7454c1cb907fb54be3b840d532e0848..a3b2931dbf6b8f18a891cf90e578ba3561de3a27 100644
--- a/components/policy/core/common/schema_map_unittest.cc
+++ b/components/policy/core/common/schema_map_unittest.cc
@@ -141,18 +141,17 @@ TEST_F(SchemaMapTest, FilterBundle) {
expected_bundle.Get(chrome_ns).Set("ChromePolicy",
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- base::Value::CreateStringValue("value"),
+ new base::StringValue("value"),
NULL);
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,
- base::Value::CreateStringValue("value"),
- NULL);
+ bundle.Get(another_extension_ns).Set("AnotherExtensionPolicy",
+ POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER,
+ new base::StringValue("value"),
+ NULL);
schema_map->FilterBundle(&bundle);
EXPECT_TRUE(bundle.Equals(expected_bundle));
@@ -176,14 +175,17 @@ TEST_F(SchemaMapTest, FilterBundle) {
dict.SetInteger("b", 2);
map.Set("object", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
dict.DeepCopy(), NULL);
- map.Set("string", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
- base::Value::CreateStringValue("value"), NULL);
+ map.Set("string",
+ POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER,
+ new base::StringValue("value"),
+ NULL);
bundle.MergeFrom(expected_bundle);
bundle.Get(extension_ns).Set("Unexpected",
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- base::Value::CreateStringValue("to-be-removed"),
+ new base::StringValue("to-be-removed"),
NULL);
schema_map->FilterBundle(&bundle);
@@ -237,7 +239,7 @@ TEST_F(SchemaMapTest, LegacyComponents) {
bundle.Get(extension_ns).Set("String",
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- base::Value::CreateStringValue("value 1"),
+ new base::StringValue("value 1"),
NULL);
// The Chrome namespace isn't filtered.
@@ -245,7 +247,7 @@ TEST_F(SchemaMapTest, LegacyComponents) {
bundle.Get(chrome_ns).Set("ChromePolicy",
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- base::Value::CreateStringValue("value 3"),
+ new base::StringValue("value 3"),
NULL);
PolicyBundle expected_bundle;
@@ -256,14 +258,14 @@ TEST_F(SchemaMapTest, LegacyComponents) {
bundle.Get(without_schema_ns).Set("Schemaless",
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- base::Value::CreateStringValue("value 2"),
+ new base::StringValue("value 2"),
NULL);
// Unknown policies of known components with a schema are removed.
bundle.Get(extension_ns).Set("Surprise",
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- base::Value::CreateStringValue("value 4"),
+ new base::StringValue("value 4"),
NULL);
// Unknown components are removed.
@@ -271,7 +273,7 @@ TEST_F(SchemaMapTest, LegacyComponents) {
bundle.Get(unknown_ns).Set("Surprise",
POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER,
- base::Value::CreateStringValue("value 5"),
+ new base::StringValue("value 5"),
NULL);
schema_map->FilterBundle(&bundle);

Powered by Google App Engine
This is Rietveld 408576698