| 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 5352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5363 | 5363 |
| 5364 // Test that ShouldShowCreditCardSigninPromo behaves as expected for a credit | 5364 // Test that ShouldShowCreditCardSigninPromo behaves as expected for a credit |
| 5365 // card form on a non-secure page. | 5365 // card form on a non-secure page. |
| 5366 TEST_F(AutofillManagerTest, | 5366 TEST_F(AutofillManagerTest, |
| 5367 ShouldShowCreditCardSigninPromo_CreditCardField_NonSecureContext) { | 5367 ShouldShowCreditCardSigninPromo_CreditCardField_NonSecureContext) { |
| 5368 // Set up our form data. | 5368 // Set up our form data. |
| 5369 FormData form; | 5369 FormData form; |
| 5370 CreateTestCreditCardFormData(&form, false, false); | 5370 CreateTestCreditCardFormData(&form, false, false); |
| 5371 form.origin = GURL("http://myform.com/form.html"); | 5371 form.origin = GURL("http://myform.com/form.html"); |
| 5372 form.action = GURL("https://myform.com/submit.html"); | 5372 form.action = GURL("https://myform.com/submit.html"); |
| 5373 autofill_client_.set_form_origin(form.origin); |
| 5373 std::vector<FormData> forms(1, form); | 5374 std::vector<FormData> forms(1, form); |
| 5374 FormsSeen(forms); | 5375 FormsSeen(forms); |
| 5375 | 5376 |
| 5376 FormFieldData field; | 5377 FormFieldData field; |
| 5377 test::CreateTestFormField("Name on Card", "nameoncard", "", "text", &field); | 5378 test::CreateTestFormField("Name on Card", "nameoncard", "", "text", &field); |
| 5378 | 5379 |
| 5379 // Both calls will now return false, regardless of the mock implementation of | 5380 // Both calls will now return false, regardless of the mock implementation of |
| 5380 // ShouldShowSigninPromo(). | 5381 // ShouldShowSigninPromo(). |
| 5381 EXPECT_CALL(autofill_client_, ShouldShowSigninPromo()) | 5382 EXPECT_CALL(autofill_client_, ShouldShowSigninPromo()) |
| 5382 .WillOnce(testing::Return(true)); | 5383 .WillOnce(testing::Return(true)); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5641 | 5642 |
| 5642 // The driver should always be notified. | 5643 // The driver should always be notified. |
| 5643 for (const FormFieldData& field : form.fields) { | 5644 for (const FormFieldData& field : form.fields) { |
| 5644 GetAutofillSuggestions(form, field); | 5645 GetAutofillSuggestions(form, field); |
| 5645 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); | 5646 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); |
| 5646 autofill_driver_->ClearDidInteractWithCreditCardForm(); | 5647 autofill_driver_->ClearDidInteractWithCreditCardForm(); |
| 5647 } | 5648 } |
| 5648 } | 5649 } |
| 5649 | 5650 |
| 5650 } // namespace autofill | 5651 } // namespace autofill |
| OLD | NEW |