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

Unified Diff: components/autofill/core/browser/credit_card_unittest.cc

Issue 2639403002: [Autofill] Remove direct use of base::Time::Now() in Autofill (Closed)
Patch Set: Rebase Created 3 years, 11 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/core/browser/credit_card_unittest.cc
diff --git a/components/autofill/core/browser/credit_card_unittest.cc b/components/autofill/core/browser/credit_card_unittest.cc
index de26d8e56d3c4588920b026832e5393fde5f8d32..b32f7b6e8db0f385f47aa30266a62d769d267ef1 100644
--- a/components/autofill/core/browser/credit_card_unittest.cc
+++ b/components/autofill/core/browser/credit_card_unittest.cc
@@ -10,6 +10,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "components/autofill/core/browser/autofill_clock.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/credit_card.h"
@@ -510,7 +511,7 @@ TEST(CreditCardTest, UpdateFromImportedCard) {
TEST(CreditCardTest, IsValid) {
CreditCard card;
// Invalid because expired
- const base::Time now(base::Time::Now());
+ const base::Time now(AutofillClock::Now());
base::Time::Exploded now_exploded;
now.LocalExplode(&now_exploded);
card.SetRawInfo(CREDIT_CARD_EXP_MONTH,
@@ -790,7 +791,7 @@ TEST(CreditCardTest, LastFourDigits) {
// Verifies that a credit card should be updated.
TEST(CreditCardTest, ShouldUpdateExpiration) {
- base::Time now = base::Time::Now();
+ base::Time now = AutofillClock::Now();
base::Time::Exploded last_year;
(now - base::TimeDelta::FromDays(365)).LocalExplode(&last_year);

Powered by Google App Engine
This is Rietveld 408576698