| 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 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 GetAutofillSuggestions(form, field); | 1264 GetAutofillSuggestions(form, field); |
| 1265 | 1265 |
| 1266 // Test that we sent the right values to the external delegate. Inferred | 1266 // Test that we sent the right values to the external delegate. Inferred |
| 1267 // labels include full first relevant field, which in this case is the | 1267 // labels include full first relevant field, which in this case is the |
| 1268 // address line 1. | 1268 // address line 1. |
| 1269 external_delegate_->CheckSuggestions( | 1269 external_delegate_->CheckSuggestions( |
| 1270 kDefaultPageID, Suggestion("Charles", "123 Apple St.", "", 1), | 1270 kDefaultPageID, Suggestion("Charles", "123 Apple St.", "", 1), |
| 1271 Suggestion("Elvis", "3734 Elvis Presley Blvd.", "", 2)); | 1271 Suggestion("Elvis", "3734 Elvis Presley Blvd.", "", 2)); |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 // Test that the HttpWarning does not appear on non-payment forms. |
| 1275 TEST_F(AutofillManagerTest, GetProfileSuggestions_EmptyValueNotSecure) { |
| 1276 SetHttpWarningEnabled(); |
| 1277 // Set up our form data. |
| 1278 FormData form; |
| 1279 test::CreateTestAddressFormData(&form); |
| 1280 std::vector<FormData> forms(1, form); |
| 1281 FormsSeen(forms); |
| 1282 |
| 1283 const FormFieldData& field = form.fields[0]; |
| 1284 GetAutofillSuggestions(form, field); |
| 1285 |
| 1286 // Test that we sent the right values to the external delegate. |
| 1287 external_delegate_->CheckSuggestions( |
| 1288 kDefaultPageID, Suggestion("Charles", "123 Apple St.", "", 1), |
| 1289 Suggestion("Elvis", "3734 Elvis Presley Blvd.", "", 2)); |
| 1290 } |
| 1291 |
| 1274 // Test that we return only matching address profile suggestions when the | 1292 // Test that we return only matching address profile suggestions when the |
| 1275 // selected form field has been partially filled out. | 1293 // selected form field has been partially filled out. |
| 1276 TEST_F(AutofillManagerTest, GetProfileSuggestions_MatchCharacter) { | 1294 TEST_F(AutofillManagerTest, GetProfileSuggestions_MatchCharacter) { |
| 1277 // Set up our form data. | 1295 // Set up our form data. |
| 1278 FormData form; | 1296 FormData form; |
| 1279 test::CreateTestAddressFormData(&form); | 1297 test::CreateTestAddressFormData(&form); |
| 1280 std::vector<FormData> forms(1, form); | 1298 std::vector<FormData> forms(1, form); |
| 1281 FormsSeen(forms); | 1299 FormsSeen(forms); |
| 1282 | 1300 |
| 1283 FormFieldData field; | 1301 FormFieldData field; |
| (...skipping 4306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5590 | 5608 |
| 5591 // The driver should always be notified. | 5609 // The driver should always be notified. |
| 5592 for (const FormFieldData& field : form.fields) { | 5610 for (const FormFieldData& field : form.fields) { |
| 5593 GetAutofillSuggestions(form, field); | 5611 GetAutofillSuggestions(form, field); |
| 5594 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); | 5612 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); |
| 5595 autofill_driver_->ClearDidInteractWithCreditCardForm(); | 5613 autofill_driver_->ClearDidInteractWithCreditCardForm(); |
| 5596 } | 5614 } |
| 5597 } | 5615 } |
| 5598 | 5616 |
| 5599 } // namespace autofill | 5617 } // namespace autofill |
| OLD | NEW |