OLD | NEW |
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 "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "components/autofill/content/browser/wallet/wallet_address.h" | 10 #include "components/autofill/content/browser/wallet/wallet_address.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } // anonymous namespace | 155 } // anonymous namespace |
156 | 156 |
157 namespace autofill { | 157 namespace autofill { |
158 namespace wallet { | 158 namespace wallet { |
159 | 159 |
160 class WalletAddressTest : public testing::Test { | 160 class WalletAddressTest : public testing::Test { |
161 public: | 161 public: |
162 WalletAddressTest() {} | 162 WalletAddressTest() {} |
163 protected: | 163 protected: |
164 void SetUpDictionary(const std::string& json) { | 164 void SetUpDictionary(const std::string& json) { |
165 scoped_ptr<Value> value(base::JSONReader::Read(json)); | 165 scoped_ptr<base::Value> value(base::JSONReader::Read(json)); |
166 DCHECK(value.get()); | 166 DCHECK(value.get()); |
167 DCHECK(value->IsType(Value::TYPE_DICTIONARY)); | 167 DCHECK(value->IsType(base::Value::TYPE_DICTIONARY)); |
168 dict_.reset(static_cast<DictionaryValue*>(value.release())); | 168 dict_.reset(static_cast<base::DictionaryValue*>(value.release())); |
169 } | 169 } |
170 scoped_ptr<const DictionaryValue> dict_; | 170 scoped_ptr<const base::DictionaryValue> dict_; |
171 }; | 171 }; |
172 | 172 |
173 TEST_F(WalletAddressTest, AddressEqualsIgnoreID) { | 173 TEST_F(WalletAddressTest, AddressEqualsIgnoreID) { |
174 Address address1("US", | 174 Address address1("US", |
175 ASCIIToUTF16("recipient_name"), | 175 ASCIIToUTF16("recipient_name"), |
176 ASCIIToUTF16("address_line_1"), | 176 ASCIIToUTF16("address_line_1"), |
177 ASCIIToUTF16("address_line_2"), | 177 ASCIIToUTF16("address_line_2"), |
178 ASCIIToUTF16("locality_name"), | 178 ASCIIToUTF16("locality_name"), |
179 ASCIIToUTF16("administrative_area_name"), | 179 ASCIIToUTF16("administrative_area_name"), |
180 ASCIIToUTF16("postal_code_number"), | 180 ASCIIToUTF16("postal_code_number"), |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 ASCIIToUTF16("locality_name"), | 469 ASCIIToUTF16("locality_name"), |
470 ASCIIToUTF16("administrative_area_name"), | 470 ASCIIToUTF16("administrative_area_name"), |
471 ASCIIToUTF16("postal_code_number"), | 471 ASCIIToUTF16("postal_code_number"), |
472 ASCIIToUTF16("phone_number"), | 472 ASCIIToUTF16("phone_number"), |
473 "id1"); | 473 "id1"); |
474 EXPECT_EQ(base::string16(), address3.GetInfo(type, "en-US")); | 474 EXPECT_EQ(base::string16(), address3.GetInfo(type, "en-US")); |
475 } | 475 } |
476 | 476 |
477 } // namespace wallet | 477 } // namespace wallet |
478 } // namespace autofill | 478 } // namespace autofill |
OLD | NEW |