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

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

Issue 1540423004: Add card details and legal message to Android save credit card infobar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: components/autofill review. Created 4 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/autofill_manager_unittest.cc
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc
index 177bb9ba20e0e27463523b9ddd449c14274003b7..0e9e81339f1c08207cc9ca0a2e875bb3c88b7ff2 100644
--- a/components/autofill/core/browser/autofill_manager_unittest.cc
+++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -68,8 +68,8 @@ class MockAutofillClient : public TestAutofillClient {
~MockAutofillClient() override {}
- MOCK_METHOD1(ConfirmSaveCreditCardLocally,
- void(const base::Closure& callback));
+ MOCK_METHOD2(ConfirmSaveCreditCardLocally,
+ void(const CreditCard& card, const base::Closure& callback));
private:
DISALLOW_COPY_AND_ASSIGN(MockAutofillClient);
@@ -878,7 +878,7 @@ class AutofillManagerTest : public testing::Test {
form.fields[1].value = ASCIIToUTF16("4111111111111111");
form.fields[2].value = ASCIIToUTF16("11");
form.fields[3].value = ASCIIToUTF16("2017");
- EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_)).Times(1);
+ EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _));
FormSubmitted(form);
}
@@ -895,7 +895,7 @@ class AutofillManagerTest : public testing::Test {
"2017");
card->SetTypeForMaskedCard(kVisaCard);
- EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_)).Times(0);
+ EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _)).Times(0);
EXPECT_CALL(*autofill_driver_, SendFormDataToRenderer(_, _, _))
.Times(AtLeast(1));
autofill_manager_->FillOrPreviewCreditCardForm(
@@ -2596,7 +2596,7 @@ TEST_F(AutofillManagerTest, FormSubmittedAutocompleteEnabled) {
MockAutocompleteHistoryManager* m = static_cast<
MockAutocompleteHistoryManager*>(
autofill_manager_->autocomplete_history_manager_.get());
- EXPECT_CALL(*m, OnWillSubmitForm(_)).Times(1);
+ EXPECT_CALL(*m, OnWillSubmitForm(_));
FormSubmitted(form);
}
@@ -2623,7 +2623,7 @@ TEST_F(AutofillManagerTest, AutocompleteSuggestions_SomeWhenAutofillDisabled) {
MockAutocompleteHistoryManager*>(
autofill_manager_->autocomplete_history_manager_.get());
EXPECT_CALL(*m,
- OnGetAutocompleteSuggestions(_, _, _, _)).Times(1);
+ OnGetAutocompleteSuggestions(_, _, _, _));
GetAutofillSuggestions(form, field);
}
@@ -2710,7 +2710,7 @@ TEST_F(AutofillManagerTest, AutocompleteSuggestions_SomeWhenAutofillEmpty) {
MockAutocompleteHistoryManager*>(
autofill_manager_->autocomplete_history_manager_.get());
EXPECT_CALL(*m,
- OnGetAutocompleteSuggestions(_, _, _, _)).Times(1);
+ OnGetAutocompleteSuggestions(_, _, _, _));
GetAutofillSuggestions(form, field);
}
@@ -3047,7 +3047,7 @@ TEST_F(AutofillManagerTest, CreditCardSavedWhenAutocompleteOff) {
form.fields[1].value = ASCIIToUTF16("4111111111111111");
form.fields[2].value = ASCIIToUTF16("11");
form.fields[3].value = ASCIIToUTF16("2017");
- EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_)).Times(1);
+ EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _));
FormSubmitted(form);
}
@@ -3066,7 +3066,7 @@ TEST_F(AutofillManagerTest, InvalidCreditCardNumberIsNotSaved) {
form.fields[1].value = ASCIIToUTF16(card);
form.fields[2].value = ASCIIToUTF16("11");
form.fields[3].value = ASCIIToUTF16("2017");
- EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_)).Times(0);
+ EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _)).Times(0);
FormSubmitted(form);
}
@@ -3665,7 +3665,7 @@ TEST_F(AutofillManagerTest, DontUploadCreditCardIfFeatureNotEnabled) {
base::HistogramTester histogram_tester;
// The save prompt should be shown instead of doing an upload.
- EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_)).Times(1);
+ EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _));
FormSubmitted(credit_card_form);
EXPECT_FALSE(autofill_manager_->credit_card_was_uploaded());
@@ -3699,7 +3699,7 @@ TEST_F(AutofillManagerTest, DontUploadCreditCardIfCvcUnavailable) {
base::HistogramTester histogram_tester;
// Neither a local save nor an upload should happen in this case.
- EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_)).Times(0);
+ EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _)).Times(0);
FormSubmitted(credit_card_form);
EXPECT_FALSE(autofill_manager_->credit_card_was_uploaded());
@@ -3736,7 +3736,7 @@ TEST_F(AutofillManagerTest, DontUploadCreditCardIfNoMatchingProfileAvailable) {
base::HistogramTester histogram_tester;
// Neither a local save nor an upload should happen in this case.
- EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_)).Times(0);
+ EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _)).Times(0);
FormSubmitted(credit_card_form);
EXPECT_FALSE(autofill_manager_->credit_card_was_uploaded());
@@ -3776,7 +3776,7 @@ TEST_F(AutofillManagerTest, DontUploadCreditCardIfUploadDetailsFails) {
base::HistogramTester histogram_tester;
// The save prompt should be shown instead of doing an upload.
- EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_)).Times(1);
+ EXPECT_CALL(autofill_client_, ConfirmSaveCreditCardLocally(_, _));
FormSubmitted(credit_card_form);
EXPECT_FALSE(autofill_manager_->credit_card_was_uploaded());

Powered by Google App Engine
This is Rietveld 408576698