| 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 3649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3660 // Set the address field's value back to the default value. | 3660 // Set the address field's value back to the default value. |
| 3661 response_data.fields[3].value = ASCIIToUTF16("Enter your address"); | 3661 response_data.fields[3].value = ASCIIToUTF16("Enter your address"); |
| 3662 | 3662 |
| 3663 // Simulate form submission. We should not call into the PDM to try to save | 3663 // Simulate form submission. We should not call into the PDM to try to save |
| 3664 // the filled data, since the filled form is effectively missing an address. | 3664 // the filled data, since the filled form is effectively missing an address. |
| 3665 FormSubmitted(response_data); | 3665 FormSubmitted(response_data); |
| 3666 EXPECT_EQ(1, personal_data_.num_times_save_imported_profile_called()); | 3666 EXPECT_EQ(1, personal_data_.num_times_save_imported_profile_called()); |
| 3667 } | 3667 } |
| 3668 | 3668 |
| 3669 // Tests that credit card data are saved for forms on https | 3669 // Tests that credit card data are saved for forms on https |
| 3670 TEST_F(AutofillManagerTest, ImportFormDataCreditCardHTTPS) { | 3670 // TODO(crbug.com/666704): Flaky on android_n5x_swarming_rel bot. |
| 3671 #if defined(OS_ANDROID) |
| 3672 #define MAYBE_ImportFormDataCreditCardHTTPS \ |
| 3673 DISABLED_ImportFormDataCreditCardHTTPS |
| 3674 #else |
| 3675 #define MAYBE_ImportFormDataCreditCardHTTPS ImportFormDataCreditCardHTTPS |
| 3676 #endif |
| 3677 TEST_F(AutofillManagerTest, MAYBE_ImportFormDataCreditCardHTTPS) { |
| 3671 TestSaveCreditCards(true); | 3678 TestSaveCreditCards(true); |
| 3672 } | 3679 } |
| 3673 | 3680 |
| 3674 // Tests that credit card data are saved for forms on http | 3681 // Tests that credit card data are saved for forms on http |
| 3675 TEST_F(AutofillManagerTest, ImportFormDataCreditCardHTTP) { | 3682 // TODO(crbug.com/666704): Flaky on android_n5x_swarming_rel bot. |
| 3683 #if defined(OS_ANDROID) |
| 3684 #define MAYBE_ImportFormDataCreditCardHTTP DISABLED_ImportFormDataCreditCardHTTP |
| 3685 #else |
| 3686 #define MAYBE_ImportFormDataCreditCardHTTP ImportFormDataCreditCardHTTP |
| 3687 #endif |
| 3688 TEST_F(AutofillManagerTest, MAYBE_ImportFormDataCreditCardHTTP) { |
| 3676 TestSaveCreditCards(false); | 3689 TestSaveCreditCards(false); |
| 3677 } | 3690 } |
| 3678 | 3691 |
| 3679 // Tests that credit card data are saved when autocomplete=off for CC field. | 3692 // Tests that credit card data are saved when autocomplete=off for CC field. |
| 3680 TEST_F(AutofillManagerTest, CreditCardSavedWhenAutocompleteOff) { | 3693 TEST_F(AutofillManagerTest, CreditCardSavedWhenAutocompleteOff) { |
| 3681 // Set up our form data. | 3694 // Set up our form data. |
| 3682 FormData form; | 3695 FormData form; |
| 3683 CreateTestCreditCardFormData(&form, false, false); | 3696 CreateTestCreditCardFormData(&form, false, false); |
| 3684 | 3697 |
| 3685 // Set "autocomplete=off" for cardnumber field. | 3698 // Set "autocomplete=off" for cardnumber field. |
| (...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5526 | 5539 |
| 5527 // The driver should always be notified. | 5540 // The driver should always be notified. |
| 5528 for (const FormFieldData& field : form.fields) { | 5541 for (const FormFieldData& field : form.fields) { |
| 5529 GetAutofillSuggestions(form, field); | 5542 GetAutofillSuggestions(form, field); |
| 5530 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); | 5543 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); |
| 5531 autofill_driver_->ClearDidInteractWithCreditCardForm(); | 5544 autofill_driver_->ClearDidInteractWithCreditCardForm(); |
| 5532 } | 5545 } |
| 5533 } | 5546 } |
| 5534 | 5547 |
| 5535 } // namespace autofill | 5548 } // namespace autofill |
| OLD | NEW |