| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/autofill/core/browser/autofill_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 4461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4472 CardUnmaskDelegate::UnmaskResponse response; | 4472 CardUnmaskDelegate::UnmaskResponse response; |
| 4473 response.should_store_pan = false; | 4473 response.should_store_pan = false; |
| 4474 response.cvc = ASCIIToUTF16("123"); | 4474 response.cvc = ASCIIToUTF16("123"); |
| 4475 response.exp_month = ASCIIToUTF16("02"); | 4475 response.exp_month = ASCIIToUTF16("02"); |
| 4476 response.exp_year = ASCIIToUTF16("2018"); | 4476 response.exp_year = ASCIIToUTF16("2018"); |
| 4477 full_card_unmask_delegate()->OnUnmaskResponse(response); | 4477 full_card_unmask_delegate()->OnUnmaskResponse(response); |
| 4478 autofill_manager_->OnDidGetRealPan(AutofillClient::SUCCESS, | 4478 autofill_manager_->OnDidGetRealPan(AutofillClient::SUCCESS, |
| 4479 "4012888888881881"); | 4479 "4012888888881881"); |
| 4480 } | 4480 } |
| 4481 | 4481 |
| 4482 TEST_F(AutofillManagerTest, UploadCreditCard) { | 4482 // TODO(crbug.com/666704): Flaky on android_n5x_swarming_rel bot. |
| 4483 #if defined(OS_ANDROID) |
| 4484 #define MAYBE_UploadCreditCard DISABLED_UploadCreditCard |
| 4485 #else |
| 4486 #define MAYBE_UploadCreditCard UploadCreditCard |
| 4487 #endif |
| 4488 TEST_F(AutofillManagerTest, MAYBE_UploadCreditCard) { |
| 4483 personal_data_.ClearAutofillProfiles(); | 4489 personal_data_.ClearAutofillProfiles(); |
| 4484 autofill_manager_->set_credit_card_upload_enabled(true); | 4490 autofill_manager_->set_credit_card_upload_enabled(true); |
| 4485 | 4491 |
| 4486 // Create, fill and submit an address form in order to establish a recent | 4492 // Create, fill and submit an address form in order to establish a recent |
| 4487 // profile which can be selected for the upload request. | 4493 // profile which can be selected for the upload request. |
| 4488 FormData address_form; | 4494 FormData address_form; |
| 4489 test::CreateTestAddressFormData(&address_form); | 4495 test::CreateTestAddressFormData(&address_form); |
| 4490 FormsSeen(std::vector<FormData>(1, address_form)); | 4496 FormsSeen(std::vector<FormData>(1, address_form)); |
| 4491 ManuallyFillAddressForm("Flo", "Master", "77401", "US", &address_form); | 4497 ManuallyFillAddressForm("Flo", "Master", "77401", "US", &address_form); |
| 4492 FormSubmitted(address_form); | 4498 FormSubmitted(address_form); |
| (...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5539 | 5545 |
| 5540 // The driver should always be notified. | 5546 // The driver should always be notified. |
| 5541 for (const FormFieldData& field : form.fields) { | 5547 for (const FormFieldData& field : form.fields) { |
| 5542 GetAutofillSuggestions(form, field); | 5548 GetAutofillSuggestions(form, field); |
| 5543 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); | 5549 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); |
| 5544 autofill_driver_->ClearDidInteractWithCreditCardForm(); | 5550 autofill_driver_->ClearDidInteractWithCreditCardForm(); |
| 5545 } | 5551 } |
| 5546 } | 5552 } |
| 5547 | 5553 |
| 5548 } // namespace autofill | 5554 } // namespace autofill |
| OLD | NEW |