Index: chrome/browser/autofill/autofill_profile_unittest.cc |
diff --git a/chrome/browser/autofill/autofill_profile_unittest.cc b/chrome/browser/autofill/autofill_profile_unittest.cc |
index a5fa207e11cfd4534c69ab18703a91ec7f03c6df..df83ae16037b397dde0a57aba1852f956a0548af 100644 |
--- a/chrome/browser/autofill/autofill_profile_unittest.cc |
+++ b/chrome/browser/autofill/autofill_profile_unittest.cc |
@@ -11,6 +11,7 @@ |
#include "chrome/browser/autofill/autofill_common_test.h" |
#include "chrome/browser/autofill/autofill_profile.h" |
#include "chrome/common/guid.h" |
+#include "chrome/test/testing_browser_process_test.h" |
#include "grit/generated_resources.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -24,9 +25,11 @@ bool UpdateProfileLabel(AutofillProfile *profile) { |
} // namespace |
+typedef TestingBrowserProcessTest AutofillProfileTest; |
+ |
// Tests different possibilities for summary string generation. |
// Based on existence of first name, last name, and address line 1. |
-TEST(AutofillProfileTest, PreviewSummaryString) { |
+TEST_F(AutofillProfileTest, PreviewSummaryString) { |
// Case 0/null: "" |
AutofillProfile profile0; |
// Empty profile - nothing to update. |
@@ -128,7 +131,7 @@ TEST(AutofillProfileTest, PreviewSummaryString) { |
"Marion Mitchell Morrison, 123 Zoo St., marion@me.xyz"), summary7a); |
} |
-TEST(AutofillProfileTest, AdjustInferredLabels) { |
+TEST_F(AutofillProfileTest, AdjustInferredLabels) { |
std::vector<AutofillProfile*> profiles; |
profiles.push_back(new AutofillProfile); |
autofill_test::SetProfileInfo( |
@@ -294,7 +297,7 @@ TEST(AutofillProfileTest, AdjustInferredLabels) { |
STLDeleteContainerPointers(profiles.begin(), profiles.end()); |
} |
-TEST(AutofillProfileTest, CreateInferredLabels) { |
+TEST_F(AutofillProfileTest, CreateInferredLabels) { |
std::vector<AutofillProfile*> profiles; |
profiles.push_back(new AutofillProfile); |
autofill_test::SetProfileInfo(profiles[0], |
@@ -396,7 +399,7 @@ TEST(AutofillProfileTest, CreateInferredLabels) { |
// Test that we fall back to using the full name if there are no other |
// distinguishing fields, but only if it makes sense given the suggested fields. |
-TEST(AutofillProfileTest, CreateInferredLabelsFallsBackToFullName) { |
+TEST_F(AutofillProfileTest, CreateInferredLabelsFallsBackToFullName) { |
ScopedVector<AutofillProfile> profiles; |
profiles.push_back(new AutofillProfile); |
autofill_test::SetProfileInfo(profiles[0], |
@@ -430,7 +433,7 @@ TEST(AutofillProfileTest, CreateInferredLabelsFallsBackToFullName) { |
} |
// Test that we do not show duplicate fields in the labels. |
-TEST(AutofillProfileTest, CreateInferredLabelsNoDuplicatedFields) { |
+TEST_F(AutofillProfileTest, CreateInferredLabelsNoDuplicatedFields) { |
ScopedVector<AutofillProfile> profiles; |
profiles.push_back(new AutofillProfile); |
autofill_test::SetProfileInfo(profiles[0], |
@@ -456,7 +459,7 @@ TEST(AutofillProfileTest, CreateInferredLabelsNoDuplicatedFields) { |
} |
// Make sure that empty fields are not treated as distinguishing fields. |
-TEST(AutofillProfileTest, CreateInferredLabelsSkipsEmptyFields) { |
+TEST_F(AutofillProfileTest, CreateInferredLabelsSkipsEmptyFields) { |
ScopedVector<AutofillProfile> profiles; |
profiles.push_back(new AutofillProfile); |
autofill_test::SetProfileInfo(profiles[0], |
@@ -491,7 +494,7 @@ TEST(AutofillProfileTest, CreateInferredLabelsSkipsEmptyFields) { |
EXPECT_EQ(ASCIIToUTF16("John Doe, john.doe@example.com"), labels[2]); |
} |
-TEST(AutofillProfileTest, IsSubsetOf) { |
+TEST_F(AutofillProfileTest, IsSubsetOf) { |
scoped_ptr<AutofillProfile> a, b; |
// |a| is a subset of |b|. |
@@ -523,7 +526,7 @@ TEST(AutofillProfileTest, IsSubsetOf) { |
EXPECT_FALSE(a->IsSubsetOf(*b)); |
} |
-TEST(AutofillProfileTest, IntersectionOfTypesHasEqualValues) { |
+TEST_F(AutofillProfileTest, IntersectionOfTypesHasEqualValues) { |
scoped_ptr<AutofillProfile> a, b; |
// Intersection of types contains the fields NAME_FIRST, NAME_LAST, |
@@ -563,7 +566,7 @@ TEST(AutofillProfileTest, IntersectionOfTypesHasEqualValues) { |
EXPECT_FALSE(a->IntersectionOfTypesHasEqualValues(*b)); |
} |
-TEST(AutofillProfileTest, MergeWith) { |
+TEST_F(AutofillProfileTest, MergeWith) { |
scoped_ptr<AutofillProfile> a, b; |
// Merge |b| into |a|. |
@@ -586,7 +589,7 @@ TEST(AutofillProfileTest, MergeWith) { |
EXPECT_EQ(0, expected_b.Compare(*b)); |
} |
-TEST(AutofillProfileTest, AssignmentOperator){ |
+TEST_F(AutofillProfileTest, AssignmentOperator){ |
AutofillProfile a, b; |
// Result of assignment should be logically equal to the original profile. |
@@ -602,7 +605,7 @@ TEST(AutofillProfileTest, AssignmentOperator){ |
EXPECT_TRUE(a == b); |
} |
-TEST(AutofillProfileTest, Copy) { |
+TEST_F(AutofillProfileTest, Copy) { |
AutofillProfile a; |
// Clone should be logically equal to the original. |
@@ -614,7 +617,7 @@ TEST(AutofillProfileTest, Copy) { |
EXPECT_TRUE(a == b); |
} |
-TEST(AutofillProfileTest, Compare) { |
+TEST_F(AutofillProfileTest, Compare) { |
AutofillProfile a, b; |
// Empty profiles are the same. |
@@ -634,7 +637,7 @@ TEST(AutofillProfileTest, Compare) { |
EXPECT_LT(0, b.Compare(a)); |
} |
-TEST(AutofillProfileTest, CountryCode) { |
+TEST_F(AutofillProfileTest, CountryCode) { |
AutofillProfile profile; |
EXPECT_EQ(std::string(), profile.CountryCode()); |
@@ -642,7 +645,7 @@ TEST(AutofillProfileTest, CountryCode) { |
EXPECT_EQ("US", profile.CountryCode()); |
} |
-TEST(AutofillProfileTest, MultiValueNames) { |
+TEST_F(AutofillProfileTest, MultiValueNames) { |
AutofillProfile p; |
const string16 kJohnDoe(ASCIIToUTF16("John Doe")); |
const string16 kJohnPDoe(ASCIIToUTF16("John P. Doe")); |
@@ -686,7 +689,7 @@ TEST(AutofillProfileTest, MultiValueNames) { |
EXPECT_EQ(string16(), p.GetInfo(NAME_FULL)); |
} |
-TEST(AutofillProfileTest, MultiValueEmails) { |
+TEST_F(AutofillProfileTest, MultiValueEmails) { |
AutofillProfile p; |
const string16 kJohnDoe(ASCIIToUTF16("john@doe.com")); |
const string16 kJohnPDoe(ASCIIToUTF16("john_p@doe.com")); |
@@ -730,7 +733,7 @@ TEST(AutofillProfileTest, MultiValueEmails) { |
EXPECT_EQ(string16(), p.GetInfo(EMAIL_ADDRESS)); |
} |
-TEST(AutofillProfileTest, MultiValuePhone) { |
+TEST_F(AutofillProfileTest, MultiValuePhone) { |
AutofillProfile p; |
const string16 kJohnDoe(ASCIIToUTF16("4151112222")); |
const string16 kJohnPDoe(ASCIIToUTF16("4151113333")); |
@@ -774,7 +777,7 @@ TEST(AutofillProfileTest, MultiValuePhone) { |
EXPECT_EQ(string16(), p.GetInfo(PHONE_HOME_WHOLE_NUMBER)); |
} |
-TEST(AutofillProfileTest, MultiValueFax) { |
+TEST_F(AutofillProfileTest, MultiValueFax) { |
AutofillProfile p; |
const string16 kJohnDoe(ASCIIToUTF16("4152112222")); |
const string16 kJohnPDoe(ASCIIToUTF16("4153113333")); |