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

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

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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/policy_loader_win_unittest.cc
diff --git a/components/policy/core/common/policy_loader_win_unittest.cc b/components/policy/core/common/policy_loader_win_unittest.cc
index 76adc449d8e3e68d064bbbd722ef5b6632fd58ae..c2db3f2321ebdfae1068df98c1c58eaea2fac347 100644
--- a/components/policy/core/common/policy_loader_win_unittest.cc
+++ b/components/policy/core/common/policy_loader_win_unittest.cc
@@ -402,7 +402,7 @@ void RegistryTestHarness::InstallDictionaryPolicy(
const std::string& policy_name,
const base::DictionaryValue* policy_value) {
std::string json;
- base::JSONWriter::Write(policy_value, &json);
+ base::JSONWriter::Write(*policy_value, &json);
RegKey key(hive_, kTestPolicyKey, KEY_ALL_ACCESS);
ASSERT_TRUE(key.Valid());
key.WriteValue(UTF8ToUTF16(policy_name).c_str(),
@@ -506,7 +506,7 @@ void PRegTestHarness::InstallDictionaryPolicy(
const std::string& policy_name,
const base::DictionaryValue* policy_value) {
std::string json;
- base::JSONWriter::Write(policy_value, &json);
+ base::JSONWriter::Write(*policy_value, &json);
AppendStringToPRegFile(kTestPolicyKey, policy_name, json);
}
@@ -910,11 +910,11 @@ TEST_F(PolicyLoaderWinTest, LoadStringEncodedValues) {
policy.Set("list", list.DeepCopy());
// Encode |policy| before adding the "dict" entry.
std::string encoded_dict;
- base::JSONWriter::Write(&policy, &encoded_dict);
+ base::JSONWriter::Write(policy, &encoded_dict);
ASSERT_FALSE(encoded_dict.empty());
policy.Set("dict", policy.DeepCopy());
std::string encoded_list;
- base::JSONWriter::Write(&list, &encoded_list);
+ base::JSONWriter::Write(list, &encoded_list);
ASSERT_FALSE(encoded_list.empty());
base::DictionaryValue encoded_policy;
encoded_policy.SetString("null", "");
« no previous file with comments | « components/policy/core/common/policy_loader_win.cc ('k') | components/policy/core/common/policy_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698