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

Side by Side Diff: components/policy/core/common/policy_loader_win_unittest.cc

Issue 2792573002: Remove base::Value::CreateNullValue (Closed)
Patch Set: Rebase Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/policy/core/common/policy_loader_win.h" 5 #include "components/policy/core/common/policy_loader_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <userenv.h> 10 #include <userenv.h>
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 " \"double\": { \"type\": \"number\" }," 895 " \"double\": { \"type\": \"number\" },"
896 " \"list\": {" 896 " \"list\": {"
897 " \"type\": \"array\"," 897 " \"type\": \"array\","
898 " \"items\": { \"$ref\": \"MainType\" }" 898 " \"items\": { \"$ref\": \"MainType\" }"
899 " }," 899 " },"
900 " \"dict\": { \"$ref\": \"MainType\" }" 900 " \"dict\": { \"$ref\": \"MainType\" }"
901 " }" 901 " }"
902 "}")); 902 "}"));
903 903
904 base::DictionaryValue policy; 904 base::DictionaryValue policy;
905 policy.Set("null", base::Value::CreateNullValue()); 905 policy.Set("null", base::MakeUnique<base::Value>());
906 policy.SetBoolean("bool", true); 906 policy.SetBoolean("bool", true);
907 policy.SetInteger("int", -123); 907 policy.SetInteger("int", -123);
908 policy.SetDouble("double", 456.78e9); 908 policy.SetDouble("double", 456.78e9);
909 base::ListValue list; 909 base::ListValue list;
910 list.Append(policy.DeepCopy()); 910 list.Append(policy.DeepCopy());
911 list.Append(policy.DeepCopy()); 911 list.Append(policy.DeepCopy());
912 policy.Set("list", list.DeepCopy()); 912 policy.Set("list", list.DeepCopy());
913 // Encode |policy| before adding the "dict" entry. 913 // Encode |policy| before adding the "dict" entry.
914 std::string encoded_dict; 914 std::string encoded_dict;
915 base::JSONWriter::Write(policy, &encoded_dict); 915 base::JSONWriter::Write(policy, &encoded_dict);
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 expected.Get(ns_a).LoadFrom(&expected_a, POLICY_LEVEL_MANDATORY, 1185 expected.Get(ns_a).LoadFrom(&expected_a, POLICY_LEVEL_MANDATORY,
1186 POLICY_SCOPE_MACHINE, POLICY_SOURCE_PLATFORM); 1186 POLICY_SCOPE_MACHINE, POLICY_SOURCE_PLATFORM);
1187 base::DictionaryValue expected_b; 1187 base::DictionaryValue expected_b;
1188 expected_b.SetInteger("policy 1", 2); 1188 expected_b.SetInteger("policy 1", 2);
1189 expected.Get(ns_b).LoadFrom(&expected_b, POLICY_LEVEL_MANDATORY, 1189 expected.Get(ns_b).LoadFrom(&expected_b, POLICY_LEVEL_MANDATORY,
1190 POLICY_SCOPE_MACHINE, POLICY_SOURCE_PLATFORM); 1190 POLICY_SCOPE_MACHINE, POLICY_SOURCE_PLATFORM);
1191 EXPECT_TRUE(Matches(expected)); 1191 EXPECT_TRUE(Matches(expected));
1192 } 1192 }
1193 1193
1194 } // namespace policy 1194 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/common/mac_util_unittest.cc ('k') | components/policy/core/common/registry_dict.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698