Commit 00912951 authored by Jared Saul's avatar Jared Saul Committed by Commit Bot

Add unit test for detecting HAS_GOOGLE_PAYMENTS_ACCOUNT

Bug: 789645
Change-Id: I6c07392942a49c7ce20ece83cdd5284310377559
Reviewed-on: https://chromium-review.googlesource.com/953969
Commit-Queue: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Reviewed-by: default avatarSebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541656}
parent 22dc6d72
......@@ -3105,6 +3105,35 @@ TEST_F(CreditCardSaveManagerTest, GetDetectedValues_DetectCountryCode) {
CreditCardSaveManager::DetectedValue::COUNTRY_CODE);
}
TEST_F(CreditCardSaveManagerTest,
GetDetectedValues_DetectHasGooglePaymentAccount) {
EnableAutofillUpstreamSendDetectedValuesExperiment();
personal_data_.ClearProfiles();
credit_card_save_manager_->SetCreditCardUploadEnabled(true);
// Set the billing_customer_number Priority Preference to designate existence
// of a Payments account.
autofill_client_.GetPrefs()->SetDouble(prefs::kAutofillBillingCustomerNumber,
12345);
// Set up our credit card form data.
FormData credit_card_form;
CreateTestCreditCardFormData(&credit_card_form, true, false);
FormsSeen(std::vector<FormData>(1, credit_card_form));
// Edit the data, and submit.
credit_card_form.fields[0].value = ASCIIToUTF16(""); // No name set
credit_card_form.fields[1].value = ASCIIToUTF16("4111111111111111");
credit_card_form.fields[2].value = ASCIIToUTF16("11");
credit_card_form.fields[3].value = ASCIIToUTF16(NextYear());
credit_card_form.fields[4].value = ASCIIToUTF16(""); // No CVC set
// Submit the form and check what detected_values for an upload save would be.
FormSubmitted(credit_card_form);
EXPECT_EQ(payments_client_->GetDetectedValuesSetInRequest(),
CreditCardSaveManager::DetectedValue::HAS_GOOGLE_PAYMENTS_ACCOUNT);
}
TEST_F(CreditCardSaveManagerTest, GetDetectedValues_DetectEverythingAtOnce) {
EnableAutofillUpstreamSendDetectedValuesExperiment();
personal_data_.ClearProfiles();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment