OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <limits> | 5 #include <limits> |
6 | 6 |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 EXPECT_FALSE(null1->Equals(boolean)); | 777 EXPECT_FALSE(null1->Equals(boolean)); |
778 delete null1; | 778 delete null1; |
779 delete null2; | 779 delete null2; |
780 delete boolean; | 780 delete boolean; |
781 | 781 |
782 DictionaryValue dv; | 782 DictionaryValue dv; |
783 dv.SetBoolean("a", false); | 783 dv.SetBoolean("a", false); |
784 dv.SetInteger("b", 2); | 784 dv.SetInteger("b", 2); |
785 dv.SetReal("c", 2.5); | 785 dv.SetReal("c", 2.5); |
786 dv.SetString("d1", "string"); | 786 dv.SetString("d1", "string"); |
787 dv.SetStringFromUTF16("d2", ASCIIToUTF16("http://google.com")); | 787 dv.SetString("d2", ASCIIToUTF16("http://google.com")); |
788 dv.Set("e", Value::CreateNullValue()); | 788 dv.Set("e", Value::CreateNullValue()); |
789 | 789 |
790 DictionaryValue* copy = static_cast<DictionaryValue*>(dv.DeepCopy()); | 790 DictionaryValue* copy = static_cast<DictionaryValue*>(dv.DeepCopy()); |
791 EXPECT_TRUE(dv.Equals(copy)); | 791 EXPECT_TRUE(dv.Equals(copy)); |
792 | 792 |
793 ListValue* list = new ListValue; | 793 ListValue* list = new ListValue; |
794 list->Append(Value::CreateNullValue()); | 794 list->Append(Value::CreateNullValue()); |
795 list->Append(new DictionaryValue); | 795 list->Append(new DictionaryValue); |
796 dv.Set("f", list); | 796 dv.Set("f", list); |
797 | 797 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 EXPECT_TRUE(res_sub_dict->GetString(L"sub_base_key", &sub_base_key_value)); | 1076 EXPECT_TRUE(res_sub_dict->GetString(L"sub_base_key", &sub_base_key_value)); |
1077 EXPECT_EQ("sub_base_key_value_base", sub_base_key_value); // Preserved. | 1077 EXPECT_EQ("sub_base_key_value_base", sub_base_key_value); // Preserved. |
1078 std::string sub_collide_key_value; | 1078 std::string sub_collide_key_value; |
1079 EXPECT_TRUE(res_sub_dict->GetString(L"sub_collide_key", | 1079 EXPECT_TRUE(res_sub_dict->GetString(L"sub_collide_key", |
1080 &sub_collide_key_value)); | 1080 &sub_collide_key_value)); |
1081 EXPECT_EQ("sub_collide_key_value_merge", sub_collide_key_value); // Replaced. | 1081 EXPECT_EQ("sub_collide_key_value_merge", sub_collide_key_value); // Replaced. |
1082 std::string sub_merge_key_value; | 1082 std::string sub_merge_key_value; |
1083 EXPECT_TRUE(res_sub_dict->GetString(L"sub_merge_key", &sub_merge_key_value)); | 1083 EXPECT_TRUE(res_sub_dict->GetString(L"sub_merge_key", &sub_merge_key_value)); |
1084 EXPECT_EQ("sub_merge_key_value_merge", sub_merge_key_value); // Merged in. | 1084 EXPECT_EQ("sub_merge_key_value_merge", sub_merge_key_value); // Merged in. |
1085 } | 1085 } |
OLD | NEW |