| 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 // TODO(viettrungluu): deprecate: | 497 // TODO(viettrungluu): deprecate: |
| 498 TEST_F(ValuesTest, DictionaryWithoutPathExpansionDeprecated) { | 498 TEST_F(ValuesTest, DictionaryWithoutPathExpansionDeprecated) { |
| 499 DictionaryValue dict; | 499 DictionaryValue dict; |
| 500 dict.Set(L"this.is.expanded", Value::CreateNullValue()); | 500 dict.Set(L"this.is.expanded", Value::CreateNullValue()); |
| 501 dict.SetWithoutPathExpansion(L"this.isnt.expanded", Value::CreateNullValue()); | 501 dict.SetWithoutPathExpansion(L"this.isnt.expanded", Value::CreateNullValue()); |
| 502 | 502 |
| 503 EXPECT_FALSE(dict.HasKey(L"this.is.expanded")); | 503 EXPECT_FALSE(dict.HasKey(L"this.is.expanded")); |
| 504 EXPECT_TRUE(dict.HasKey(L"this")); | 504 EXPECT_TRUE(dict.HasKey(L"this")); |
| 505 Value* value1; | 505 Value* value1; |
| 506 EXPECT_TRUE(dict.Get(L"this", &value1)); | 506 EXPECT_TRUE(dict.Get(L"this", &value1)); |
| 507 DictionaryValue* value2; | |
| 508 ASSERT_TRUE(dict.GetDictionaryWithoutPathExpansion(L"this", &value2)); | |
| 509 EXPECT_EQ(value1, value2); | |
| 510 EXPECT_EQ(1U, value2->size()); | |
| 511 | 507 |
| 512 EXPECT_TRUE(dict.HasKey(L"this.isnt.expanded")); | 508 EXPECT_TRUE(dict.HasKey(L"this.isnt.expanded")); |
| 513 Value* value3; | 509 Value* value3; |
| 514 EXPECT_FALSE(dict.Get(L"this.isnt.expanded", &value3)); | 510 EXPECT_FALSE(dict.Get(L"this.isnt.expanded", &value3)); |
| 515 Value* value4; | 511 Value* value4; |
| 516 ASSERT_TRUE(dict.GetWithoutPathExpansion(L"this.isnt.expanded", &value4)); | 512 ASSERT_TRUE(dict.GetWithoutPathExpansion(L"this.isnt.expanded", &value4)); |
| 517 EXPECT_EQ(Value::TYPE_NULL, value4->GetType()); | 513 EXPECT_EQ(Value::TYPE_NULL, value4->GetType()); |
| 518 } | 514 } |
| 519 | 515 |
| 520 TEST_F(ValuesTest, DeepCopy) { | 516 TEST_F(ValuesTest, DeepCopy) { |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 "s1", | 1203 "s1", |
| 1208 "s1.s2" | 1204 "s1.s2" |
| 1209 }; | 1205 }; |
| 1210 dict1.reset(new DictionaryValue()); | 1206 dict1.reset(new DictionaryValue()); |
| 1211 dict1->Set("s1.s2", new DictionaryValue()); | 1207 dict1->Set("s1.s2", new DictionaryValue()); |
| 1212 dict2.reset(new DictionaryValue()); | 1208 dict2.reset(new DictionaryValue()); |
| 1213 dict2->SetInteger("s1", 1); | 1209 dict2->SetInteger("s1", 1); |
| 1214 CompareDictionariesAndCheckResult(dict1.get(), dict2.get(), expected_paths8, | 1210 CompareDictionariesAndCheckResult(dict1.get(), dict2.get(), expected_paths8, |
| 1215 arraysize(expected_paths8)); | 1211 arraysize(expected_paths8)); |
| 1216 } | 1212 } |
| OLD | NEW |