| 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 "chrome/browser/autofill/contact_info.h" | 5 #include "chrome/browser/autofill/contact_info.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/autofill/autofill_type.h" | 10 #include "chrome/browser/autofill/autofill_type.h" |
| 10 #include "chrome/browser/autofill/field_types.h" | 11 #include "chrome/browser/autofill/field_types.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 13 |
| 13 class ContactInfoTest : public testing::Test { | 14 class ContactInfoTest : public testing::Test { |
| 14 public: | 15 public: |
| 15 ContactInfoTest() {} | 16 ContactInfoTest() {} |
| 16 | 17 |
| 17 string16 first(const ContactInfo& contact) { | 18 string16 first(const ContactInfo& contact) { |
| 18 return contact.first(); | 19 return contact.first(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 ASCIIToUTF16("Mikhail Yevgrafovich Saltykov-Shchedrin")); | 58 ASCIIToUTF16("Mikhail Yevgrafovich Saltykov-Shchedrin")); |
| 58 | 59 |
| 59 SetFullName(&contact_info, ASCIIToUTF16("Arthur Ignatius Conan Doyle")); | 60 SetFullName(&contact_info, ASCIIToUTF16("Arthur Ignatius Conan Doyle")); |
| 60 EXPECT_EQ(first(contact_info), ASCIIToUTF16("Arthur")); | 61 EXPECT_EQ(first(contact_info), ASCIIToUTF16("Arthur")); |
| 61 EXPECT_EQ(middle(contact_info), ASCIIToUTF16("Ignatius Conan")); | 62 EXPECT_EQ(middle(contact_info), ASCIIToUTF16("Ignatius Conan")); |
| 62 EXPECT_EQ(last(contact_info), ASCIIToUTF16("Doyle")); | 63 EXPECT_EQ(last(contact_info), ASCIIToUTF16("Doyle")); |
| 63 EXPECT_EQ(FullName(contact_info), | 64 EXPECT_EQ(FullName(contact_info), |
| 64 ASCIIToUTF16("Arthur Ignatius Conan Doyle")); | 65 ASCIIToUTF16("Arthur Ignatius Conan Doyle")); |
| 65 } | 66 } |
| 66 | 67 |
| OLD | NEW |