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 7a5f4a356286f0863576e97497b80b1289f7c417..32c861cea028c19f509d0a5d7264a49cedb79676 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 base::Closure& callback, const CreditCard& card)); |
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( |
@@ -2598,7 +2598,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); |
} |
@@ -2625,7 +2625,7 @@ TEST_F(AutofillManagerTest, AutocompleteSuggestions_SomeWhenAutofillDisabled) { |
MockAutocompleteHistoryManager*>( |
autofill_manager_->autocomplete_history_manager_.get()); |
EXPECT_CALL(*m, |
- OnGetAutocompleteSuggestions(_, _, _, _)).Times(1); |
+ OnGetAutocompleteSuggestions(_, _, _, _)); |
GetAutofillSuggestions(form, field); |
} |
@@ -2712,7 +2712,7 @@ TEST_F(AutofillManagerTest, AutocompleteSuggestions_SomeWhenAutofillEmpty) { |
MockAutocompleteHistoryManager*>( |
autofill_manager_->autocomplete_history_manager_.get()); |
EXPECT_CALL(*m, |
- OnGetAutocompleteSuggestions(_, _, _, _)).Times(1); |
+ OnGetAutocompleteSuggestions(_, _, _, _)); |
GetAutofillSuggestions(form, field); |
} |
@@ -3049,7 +3049,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); |
} |
@@ -3068,7 +3068,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); |
} |
@@ -3668,7 +3668,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()); |
@@ -3702,7 +3702,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()); |
@@ -3739,7 +3739,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()); |
@@ -3779,7 +3779,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()); |