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

Unified Diff: components/autofill/content/browser/wallet/instrument_unittest.cc

Issue 17970003: New encryption/escrow endpoints for Wallet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dane's review 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
Index: components/autofill/content/browser/wallet/instrument_unittest.cc
diff --git a/components/autofill/content/browser/wallet/instrument_unittest.cc b/components/autofill/content/browser/wallet/instrument_unittest.cc
index f4b9ee8ccd1eb76746eaaa22881055d512711cd4..b5f273f87fecbd2a9b1dacc26478742da8c48ecc 100644
--- a/components/autofill/content/browser/wallet/instrument_unittest.cc
+++ b/components/autofill/content/browser/wallet/instrument_unittest.cc
@@ -29,128 +29,6 @@ TEST(Instrument, LastFourDigits) {
GetTestShippingAddress().Pass());
EXPECT_EQ(ASCIIToUTF16(kLastFourDigits), instrument.last_four_digits());
- EXPECT_TRUE(instrument.IsValid());
-}
-
-TEST(Instrument, NoPrimaryAccountNumberIsInvalid) {
- Instrument instrument(base::string16(),
- ASCIIToUTF16(kCardVerificationNumber),
- 12,
- 2015,
- Instrument::VISA,
- GetTestShippingAddress().Pass());
-
- EXPECT_FALSE(instrument.IsValid());
-}
-
-TEST(Instrument, TooShortPrimaryAccountNumberIsInvalid) {
- Instrument instrument(ASCIIToUTF16("44447"),
- ASCIIToUTF16(kCardVerificationNumber),
- 12,
- 2015,
- Instrument::VISA,
- GetTestShippingAddress().Pass());
-
- EXPECT_FALSE(instrument.IsValid());
-}
-
-TEST(Instrument, TooLongPrimaryAccountNumberIsInvalid) {
- Instrument instrument(ASCIIToUTF16("44444444444444444448"),
- ASCIIToUTF16(kCardVerificationNumber),
- 12,
- 2015,
- Instrument::VISA,
- GetTestShippingAddress().Pass());
-
- EXPECT_FALSE(instrument.IsValid());
-}
-
-TEST(Instrument, PrimaryAccountNumberNotPassingLuhnIsInvalid) {
- Instrument instrument(ASCIIToUTF16("4444444444444444"),
- ASCIIToUTF16(kCardVerificationNumber),
- 12,
- 2015,
- Instrument::VISA,
- GetTestShippingAddress().Pass());
-
- EXPECT_FALSE(instrument.IsValid());
-}
-
-TEST(Instrument, NoCardVerificationNumberIsInvalid) {
- Instrument instrument(ASCIIToUTF16(kPrimaryAccountNumber),
- base::string16(),
- 12,
- 2015,
- Instrument::VISA,
- GetTestShippingAddress().Pass());
-
- EXPECT_FALSE(instrument.IsValid());
-}
-
-TEST(Instrument, TooShortCardVerificationNumberIsInvalid) {
- Instrument instrument(ASCIIToUTF16(kPrimaryAccountNumber),
- ASCIIToUTF16("12"),
- 12,
- 2015,
- Instrument::VISA,
- GetTestShippingAddress().Pass());
-
- EXPECT_FALSE(instrument.IsValid());
-}
-
-TEST(Instrument, TooLongCardVerificationNumberIsInvalid) {
- Instrument instrument(ASCIIToUTF16(kPrimaryAccountNumber),
- ASCIIToUTF16("12345"),
- 12,
- 2015,
- Instrument::VISA,
- GetTestShippingAddress().Pass());
-
- EXPECT_FALSE(instrument.IsValid());
-}
-
-TEST(Instrument, ZeroAsExpirationMonthIsInvalid) {
- Instrument instrument(ASCIIToUTF16(kPrimaryAccountNumber),
- ASCIIToUTF16(kCardVerificationNumber),
- 0,
- 2015,
- Instrument::VISA,
- GetTestShippingAddress().Pass());
-
- EXPECT_FALSE(instrument.IsValid());
-}
-
-TEST(Instrument, TooLargeExpirationMonthIsInvalid) {
- Instrument instrument(ASCIIToUTF16(kPrimaryAccountNumber),
- ASCIIToUTF16(kCardVerificationNumber),
- 13,
- 2015,
- Instrument::VISA,
- GetTestShippingAddress().Pass());
-
- EXPECT_FALSE(instrument.IsValid());
-}
-
-TEST(Instrument, TooSmallExpirationYearIsInvalid) {
- Instrument instrument(ASCIIToUTF16(kPrimaryAccountNumber),
- ASCIIToUTF16(kCardVerificationNumber),
- 12,
- 999,
- Instrument::VISA,
- GetTestShippingAddress().Pass());
-
- EXPECT_FALSE(instrument.IsValid());
-}
-
-TEST(Instrument, TooLargeExpirationYearIsInvalid) {
- Instrument instrument(ASCIIToUTF16(kPrimaryAccountNumber),
- ASCIIToUTF16(kCardVerificationNumber),
- 12,
- 10000,
- Instrument::VISA,
- GetTestShippingAddress().Pass());
-
- EXPECT_FALSE(instrument.IsValid());
}
TEST(Instrument, ToDictionary) {

Powered by Google App Engine
This is Rietveld 408576698