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

Unified Diff: chrome/browser/browsing_data/autofill_counter_browsertest.cc

Issue 2249773002: Scan card holder name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/browsing_data/autofill_counter_browsertest.cc
diff --git a/chrome/browser/browsing_data/autofill_counter_browsertest.cc b/chrome/browser/browsing_data/autofill_counter_browsertest.cc
index 5b123e2160fb4fcde2c7561ae2bb5824a61e1ec9..9397a9f6108cc9d4fea2ca81ba4c256c1201de90 100644
--- a/chrome/browser/browsing_data/autofill_counter_browsertest.cc
+++ b/chrome/browser/browsing_data/autofill_counter_browsertest.cc
@@ -66,11 +66,13 @@ class AutofillCounterTest : public InProcessBrowserTest {
// Credit cards --------------------------------------------------------------
- void AddCreditCard(const std::string& card_number,
+ void AddCreditCard(const std::string& card_holder_name,
+ const std::string& card_number,
int exp_month,
int exp_year) {
- autofill::CreditCard card(
- base::ASCIIToUTF16(card_number), exp_month, exp_year);
+ autofill::CreditCard card(base::ASCIIToUTF16(card_holder_name),
+ base::ASCIIToUTF16(card_number), exp_month,
+ exp_year);
std::string id = base::GenerateGUID();
credit_card_ids_.push_back(id);
card.set_guid(id);
@@ -262,17 +264,17 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, CreditCards) {
WaitForCounting();
EXPECT_EQ(0, GetNumCreditCards());
- AddCreditCard("0000-0000-0000-0000", 1, 2015);
+ AddCreditCard("Alice", "0000-0000-0000-0000", 1, 2015);
counter.Restart();
WaitForCounting();
EXPECT_EQ(1, GetNumCreditCards());
- AddCreditCard("0123-4567-8910-1112", 10, 2015);
+ AddCreditCard("Bob", "0123-4567-8910-1112", 10, 2015);
counter.Restart();
WaitForCounting();
EXPECT_EQ(2, GetNumCreditCards());
- AddCreditCard("1211-1098-7654-3210", 10, 2030);
+ AddCreditCard("Carol", "1211-1098-7654-3210", 10, 2030);
counter.Restart();
WaitForCounting();
EXPECT_EQ(3, GetNumCreditCards());
@@ -333,8 +335,8 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, ComplexResult) {
AddAutocompleteSuggestion("tel", "+987654321");
AddAutocompleteSuggestion("city", "Munich");
- AddCreditCard("0000-0000-0000-0000", 1, 2015);
- AddCreditCard("1211-1098-7654-3210", 10, 2030);
+ AddCreditCard("Alice", "0000-0000-0000-0000", 1, 2015);
+ AddCreditCard("Bob", "1211-1098-7654-3210", 10, 2030);
AddAddress("John", "Doe", "Main Street 12345");
AddAddress("Jane", "Smith", "Main Street 12346");
@@ -359,7 +361,7 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, TimeRanges) {
base::Time time1 = base::Time::FromTimeT(base::Time::Now().ToTimeT());
AddAutocompleteSuggestion("email", "example@example.com");
- AddCreditCard("0000-0000-0000-0000", 1, 2015);
+ AddCreditCard("Alice", "0000-0000-0000-0000", 1, 2015);
AddAddress("John", "Doe", "Main Street 12345");
WaitForDBThread();
@@ -367,7 +369,7 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, TimeRanges) {
base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
base::Time time2 = base::Time::FromTimeT(base::Time::Now().ToTimeT());
- AddCreditCard("0123-4567-8910-1112", 10, 2015);
+ AddCreditCard("Bob", "0123-4567-8910-1112", 10, 2015);
AddAddress("Jane", "Smith", "Main Street 12346");
AddAddress("John", "Smith", "Side Street 47");
WaitForDBThread();
@@ -377,7 +379,7 @@ IN_PROC_BROWSER_TEST_F(AutofillCounterTest, TimeRanges) {
base::Time time3 = base::Time::FromTimeT(base::Time::Now().ToTimeT());
AddAutocompleteSuggestion("tel", "+987654321");
- AddCreditCard("1211-1098-7654-3210", 10, 2030);
+ AddCreditCard("Carol", "1211-1098-7654-3210", 10, 2030);
WaitForDBThread();
// Test the results for different starting points.

Powered by Google App Engine
This is Rietveld 408576698