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

Unified Diff: chrome/browser/autofill/credit_card_unittest.cc

Issue 7465041: GTTF: Use a fresh TestingBrowserProcess for each test, part #4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 9 years, 5 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
Index: chrome/browser/autofill/credit_card_unittest.cc
diff --git a/chrome/browser/autofill/credit_card_unittest.cc b/chrome/browser/autofill/credit_card_unittest.cc
index 51e551fdde6ff325478defb4d4a4a048c85caf12..3d96f31097360a9bc6e06cd89251ff3d1940883f 100644
--- a/chrome/browser/autofill/credit_card_unittest.cc
+++ b/chrome/browser/autofill/credit_card_unittest.cc
@@ -6,6 +6,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/autofill/autofill_common_test.h"
#include "chrome/browser/autofill/credit_card.h"
+#include "chrome/test/testing_browser_process_test.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -39,10 +40,12 @@ const char* const kInvalidNumbers[] = {
} // namespace
+typedef TestingBrowserProcessTest CreditCardTest;
+
// Tests credit card summary string generation. This test simulates a variety
// of different possible summary strings. Variations occur based on the
// existence of credit card number, month, and year fields.
-TEST(CreditCardTest, PreviewSummaryAndObfuscatedNumberStrings) {
+TEST_F(CreditCardTest, PreviewSummaryAndObfuscatedNumberStrings) {
// Case 0: empty credit card.
CreditCard credit_card0;
string16 summary0 = credit_card0.Label();
@@ -96,7 +99,7 @@ TEST(CreditCardTest, PreviewSummaryAndObfuscatedNumberStrings) {
EXPECT_EQ(ASCIIToUTF16("************5100"), obfuscated4);
}
-TEST(CreditCardTest, AssignmentOperator) {
+TEST_F(CreditCardTest, AssignmentOperator) {
CreditCard a, b;
// Result of assignment should be logically equal to the original profile.
@@ -110,7 +113,7 @@ TEST(CreditCardTest, AssignmentOperator) {
EXPECT_TRUE(a == b);
}
-TEST(CreditCardTest, IsValidCreditCardNumber) {
+TEST_F(CreditCardTest, IsValidCreditCardNumber) {
for (size_t i = 0; i < arraysize(kValidNumbers); ++i) {
SCOPED_TRACE(kValidNumbers[i]);
EXPECT_TRUE(
@@ -123,7 +126,7 @@ TEST(CreditCardTest, IsValidCreditCardNumber) {
}
}
-TEST(CreditCardTest, IsComplete) {
+TEST_F(CreditCardTest, IsComplete) {
CreditCard card;
EXPECT_FALSE(card.IsComplete());
card.SetInfo(CREDIT_CARD_NAME, ASCIIToUTF16("Wally T. Walrus"));
@@ -144,7 +147,7 @@ TEST(CreditCardTest, IsComplete) {
}
}
-TEST(CreditCardTest, InvalidMastercardNumber) {
+TEST_F(CreditCardTest, InvalidMastercardNumber) {
CreditCard card;
autofill_test::SetCreditCardInfo(&card, "Baby Face Nelson",
@@ -153,7 +156,7 @@ TEST(CreditCardTest, InvalidMastercardNumber) {
}
// Verify that we preserve exactly what the user typed for credit card numbers.
-TEST(CreditCardTest, SetInfoCreditCardNumber) {
+TEST_F(CreditCardTest, SetInfoCreditCardNumber) {
CreditCard card;
autofill_test::SetCreditCardInfo(&card, "Bob Dylan",
@@ -163,7 +166,7 @@ TEST(CreditCardTest, SetInfoCreditCardNumber) {
}
// Verify that we can handle both numeric and named months.
-TEST(CreditCardTest, SetInfoExpirationMonth) {
+TEST_F(CreditCardTest, SetInfoExpirationMonth) {
CreditCard card;
card.SetInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("05"));
« no previous file with comments | « chrome/browser/autofill/autofill_profile_unittest.cc ('k') | chrome/browser/autofill/phone_number_i18n_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698