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

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

Issue 2287733002: Switch //components away from base::ListValue::Append(Value*) overload. (Closed)
Patch Set: Test fix Created 4 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/schema.h" 5 #include "components/policy/core/common/schema.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 list.AppendString("a string"); 649 list.AppendString("a string");
650 list.AppendString("another string"); 650 list.AppendString("another string");
651 bundle.Set("Array", list.DeepCopy()); 651 bundle.Set("Array", list.DeepCopy());
652 } 652 }
653 653
654 { 654 {
655 base::DictionaryValue dict; 655 base::DictionaryValue dict;
656 dict.SetString("one", "string"); 656 dict.SetString("one", "string");
657 dict.SetInteger("two", 2); 657 dict.SetInteger("two", 2);
658 base::ListValue list; 658 base::ListValue list;
659 list.Append(dict.DeepCopy()); 659 list.Append(dict.CreateDeepCopy());
660 list.Append(dict.DeepCopy()); 660 list.Append(dict.CreateDeepCopy());
661 bundle.Set("ArrayOfObjects", list.DeepCopy()); 661 bundle.Set("ArrayOfObjects", list.DeepCopy());
662 } 662 }
663 663
664 { 664 {
665 base::ListValue list; 665 base::ListValue list;
666 list.AppendString("a string"); 666 list.AppendString("a string");
667 list.AppendString("another string"); 667 list.AppendString("another string");
668 base::ListValue listlist; 668 base::ListValue listlist;
669 listlist.Append(list.DeepCopy()); 669 listlist.Append(list.CreateDeepCopy());
670 listlist.Append(list.DeepCopy()); 670 listlist.Append(list.CreateDeepCopy());
671 bundle.Set("ArrayOfArray", listlist.DeepCopy()); 671 bundle.Set("ArrayOfArray", listlist.DeepCopy());
672 } 672 }
673 673
674 { 674 {
675 base::DictionaryValue dict; 675 base::DictionaryValue dict;
676 dict.SetBoolean("one", true); 676 dict.SetBoolean("one", true);
677 dict.SetInteger("two", 2); 677 dict.SetInteger("two", 2);
678 dict.SetString("additionally", "a string"); 678 dict.SetString("additionally", "a string");
679 dict.SetString("and also", "another string"); 679 dict.SetString("and also", "another string");
680 bundle.Set("Object", dict.DeepCopy()); 680 bundle.Set("Object", dict.DeepCopy());
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 1177
1178 EXPECT_FALSE(ParseFails(SchemaObjectWrapper( 1178 EXPECT_FALSE(ParseFails(SchemaObjectWrapper(
1179 "{" 1179 "{"
1180 " \"type\": \"integer\"," 1180 " \"type\": \"integer\","
1181 " \"minimum\": 10," 1181 " \"minimum\": 10,"
1182 " \"maximum\": 20" 1182 " \"maximum\": 20"
1183 "}"))); 1183 "}")));
1184 } 1184 }
1185 1185
1186 } // namespace policy 1186 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698