Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(546)

Unified Diff: components/autofill/browser/contact_info_unittest.cc

Issue 17392006: In components/autofill, move browser/ to core/browser/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to fix conflicts Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/browser/contact_info.cc ('k') | components/autofill/browser/credit_card.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/browser/contact_info_unittest.cc
diff --git a/components/autofill/browser/contact_info_unittest.cc b/components/autofill/browser/contact_info_unittest.cc
deleted file mode 100644
index 7ca72b7a409550623af01ea1297bb9e30d2f233d..0000000000000000000000000000000000000000
--- a/components/autofill/browser/contact_info_unittest.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/autofill/browser/contact_info.h"
-
-#include "base/basictypes.h"
-#include "base/strings/string_util.h"
-#include "base/strings/utf_string_conversions.h"
-#include "components/autofill/browser/autofill_type.h"
-#include "components/autofill/browser/field_types.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace autofill {
-
-TEST(NameInfoTest, SetFullName) {
- NameInfo name;
- name.SetRawInfo(NAME_FULL, ASCIIToUTF16("Virgil"));
- EXPECT_EQ(name.GetRawInfo(NAME_FIRST), ASCIIToUTF16("Virgil"));
- EXPECT_EQ(name.GetRawInfo(NAME_MIDDLE), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_LAST), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("Virgil"));
-
- name.SetRawInfo(NAME_FULL, ASCIIToUTF16("Murray Gell-Mann"));
- EXPECT_EQ(name.GetRawInfo(NAME_FIRST), ASCIIToUTF16("Murray"));
- EXPECT_EQ(name.GetRawInfo(NAME_MIDDLE), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_LAST), ASCIIToUTF16("Gell-Mann"));
- EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("Murray Gell-Mann"));
-
- name.SetRawInfo(NAME_FULL,
- ASCIIToUTF16("Mikhail Yevgrafovich Saltykov-Shchedrin"));
- EXPECT_EQ(name.GetRawInfo(NAME_FIRST), ASCIIToUTF16("Mikhail"));
- EXPECT_EQ(name.GetRawInfo(NAME_MIDDLE), ASCIIToUTF16("Yevgrafovich"));
- EXPECT_EQ(name.GetRawInfo(NAME_LAST), ASCIIToUTF16("Saltykov-Shchedrin"));
- EXPECT_EQ(name.GetRawInfo(NAME_FULL),
- ASCIIToUTF16("Mikhail Yevgrafovich Saltykov-Shchedrin"));
-
- name.SetRawInfo(NAME_FULL, ASCIIToUTF16("Arthur Ignatius Conan Doyle"));
- EXPECT_EQ(name.GetRawInfo(NAME_FIRST), ASCIIToUTF16("Arthur"));
- EXPECT_EQ(name.GetRawInfo(NAME_MIDDLE), ASCIIToUTF16("Ignatius Conan"));
- EXPECT_EQ(name.GetRawInfo(NAME_LAST), ASCIIToUTF16("Doyle"));
- EXPECT_EQ(name.GetRawInfo(NAME_FULL),
- ASCIIToUTF16("Arthur Ignatius Conan Doyle"));
-}
-
-TEST(NameInfoTest, GetFullName) {
- NameInfo name;
- name.SetRawInfo(NAME_FIRST, ASCIIToUTF16("First"));
- name.SetRawInfo(NAME_MIDDLE, base::string16());
- name.SetRawInfo(NAME_LAST, base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_FIRST), ASCIIToUTF16("First"));
- EXPECT_EQ(name.GetRawInfo(NAME_MIDDLE), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_LAST), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("First"));
-
- name.SetRawInfo(NAME_FIRST, base::string16());
- name.SetRawInfo(NAME_MIDDLE, ASCIIToUTF16("Middle"));
- name.SetRawInfo(NAME_LAST, base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_FIRST), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_MIDDLE), ASCIIToUTF16("Middle"));
- EXPECT_EQ(name.GetRawInfo(NAME_LAST), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("Middle"));
-
- name.SetRawInfo(NAME_FIRST, base::string16());
- name.SetRawInfo(NAME_MIDDLE, base::string16());
- name.SetRawInfo(NAME_LAST, ASCIIToUTF16("Last"));
- EXPECT_EQ(name.GetRawInfo(NAME_FIRST), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_MIDDLE), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_LAST), ASCIIToUTF16("Last"));
- EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("Last"));
-
- name.SetRawInfo(NAME_FIRST, ASCIIToUTF16("First"));
- name.SetRawInfo(NAME_MIDDLE, ASCIIToUTF16("Middle"));
- name.SetRawInfo(NAME_LAST, base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_FIRST), ASCIIToUTF16("First"));
- EXPECT_EQ(name.GetRawInfo(NAME_MIDDLE), ASCIIToUTF16("Middle"));
- EXPECT_EQ(name.GetRawInfo(NAME_LAST), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("First Middle"));
-
- name.SetRawInfo(NAME_FIRST, ASCIIToUTF16("First"));
- name.SetRawInfo(NAME_MIDDLE, base::string16());
- name.SetRawInfo(NAME_LAST, ASCIIToUTF16("Last"));
- EXPECT_EQ(name.GetRawInfo(NAME_FIRST), ASCIIToUTF16("First"));
- EXPECT_EQ(name.GetRawInfo(NAME_MIDDLE), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_LAST), ASCIIToUTF16("Last"));
- EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("First Last"));
-
- name.SetRawInfo(NAME_FIRST, base::string16());
- name.SetRawInfo(NAME_MIDDLE, ASCIIToUTF16("Middle"));
- name.SetRawInfo(NAME_LAST, ASCIIToUTF16("Last"));
- EXPECT_EQ(name.GetRawInfo(NAME_FIRST), base::string16());
- EXPECT_EQ(name.GetRawInfo(NAME_MIDDLE), ASCIIToUTF16("Middle"));
- EXPECT_EQ(name.GetRawInfo(NAME_LAST), ASCIIToUTF16("Last"));
- EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("Middle Last"));
-
- name.SetRawInfo(NAME_FIRST, ASCIIToUTF16("First"));
- name.SetRawInfo(NAME_MIDDLE, ASCIIToUTF16("Middle"));
- name.SetRawInfo(NAME_LAST, ASCIIToUTF16("Last"));
- EXPECT_EQ(name.GetRawInfo(NAME_FIRST), ASCIIToUTF16("First"));
- EXPECT_EQ(name.GetRawInfo(NAME_MIDDLE), ASCIIToUTF16("Middle"));
- EXPECT_EQ(name.GetRawInfo(NAME_LAST), ASCIIToUTF16("Last"));
- EXPECT_EQ(name.GetRawInfo(NAME_FULL), ASCIIToUTF16("First Middle Last"));
-}
-
-} // namespace autofill
« no previous file with comments | « components/autofill/browser/contact_info.cc ('k') | components/autofill/browser/credit_card.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698