OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/string16.h" | 7 #include "base/string16.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/autofill/address.h" | 9 #include "chrome/browser/autofill/address.h" |
10 #include "chrome/browser/autofill/autofill_type.h" | 10 #include "chrome/browser/autofill/autofill_type.h" |
11 #include "chrome/test/base/testing_browser_process_test.h" | |
12 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
13 | 12 |
14 typedef TestingBrowserProcessTest AddressTest; | 13 typedef testing::Test AddressTest; |
15 | 14 |
16 // Test that the getters and setters for country code are working. | 15 // Test that the getters and setters for country code are working. |
17 TEST_F(AddressTest, CountryCode) { | 16 TEST_F(AddressTest, CountryCode) { |
18 Address address; | 17 Address address; |
19 EXPECT_EQ(std::string(), address.country_code()); | 18 EXPECT_EQ(std::string(), address.country_code()); |
20 | 19 |
21 address.set_country_code("US"); | 20 address.set_country_code("US"); |
22 EXPECT_EQ("US", address.country_code()); | 21 EXPECT_EQ("US", address.country_code()); |
23 | 22 |
24 address.set_country_code("CA"); | 23 address.set_country_code("CA"); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 EXPECT_EQ(0U, matching_types.size()); | 108 EXPECT_EQ(0U, matching_types.size()); |
110 } | 109 } |
111 | 110 |
112 // Make sure that garbage values don't match when the country code is empty. | 111 // Make sure that garbage values don't match when the country code is empty. |
113 address.set_country_code(""); | 112 address.set_country_code(""); |
114 EXPECT_EQ(std::string(), address.country_code()); | 113 EXPECT_EQ(std::string(), address.country_code()); |
115 FieldTypeSet matching_types; | 114 FieldTypeSet matching_types; |
116 address.GetMatchingTypes(ASCIIToUTF16("Garbage"), &matching_types); | 115 address.GetMatchingTypes(ASCIIToUTF16("Garbage"), &matching_types); |
117 EXPECT_EQ(0U, matching_types.size()); | 116 EXPECT_EQ(0U, matching_types.size()); |
118 } | 117 } |
OLD | NEW |