| 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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 GetAutofillSuggestions(form, field); | 1238 GetAutofillSuggestions(form, field); |
| 1239 | 1239 |
| 1240 // Test that we sent the right values to the external delegate. Inferred | 1240 // Test that we sent the right values to the external delegate. Inferred |
| 1241 // labels include full first relevant field, which in this case is the | 1241 // labels include full first relevant field, which in this case is the |
| 1242 // address line 1. | 1242 // address line 1. |
| 1243 external_delegate_->CheckSuggestions( | 1243 external_delegate_->CheckSuggestions( |
| 1244 kDefaultPageID, Suggestion("Charles", "123 Apple St.", "", 1), | 1244 kDefaultPageID, Suggestion("Charles", "123 Apple St.", "", 1), |
| 1245 Suggestion("Elvis", "3734 Elvis Presley Blvd.", "", 2)); | 1245 Suggestion("Elvis", "3734 Elvis Presley Blvd.", "", 2)); |
| 1246 } | 1246 } |
| 1247 | 1247 |
| 1248 // Test that the HttpWarning does not appear on non-payment forms. |
| 1249 TEST_F(AutofillManagerTest, GetProfileSuggestions_EmptyValueNotSecure) { |
| 1250 SetHttpWarningEnabled(); |
| 1251 // Set up our form data. |
| 1252 FormData form; |
| 1253 test::CreateTestAddressFormData(&form); |
| 1254 std::vector<FormData> forms(1, form); |
| 1255 FormsSeen(forms); |
| 1256 |
| 1257 const FormFieldData& field = form.fields[0]; |
| 1258 GetAutofillSuggestions(form, field); |
| 1259 |
| 1260 // Test that we sent the right values to the external delegate. |
| 1261 external_delegate_->CheckSuggestions( |
| 1262 kDefaultPageID, Suggestion("Charles", "123 Apple St.", "", 1), |
| 1263 Suggestion("Elvis", "3734 Elvis Presley Blvd.", "", 2)); |
| 1264 } |
| 1265 |
| 1248 // Test that we return only matching address profile suggestions when the | 1266 // Test that we return only matching address profile suggestions when the |
| 1249 // selected form field has been partially filled out. | 1267 // selected form field has been partially filled out. |
| 1250 TEST_F(AutofillManagerTest, GetProfileSuggestions_MatchCharacter) { | 1268 TEST_F(AutofillManagerTest, GetProfileSuggestions_MatchCharacter) { |
| 1251 // Set up our form data. | 1269 // Set up our form data. |
| 1252 FormData form; | 1270 FormData form; |
| 1253 test::CreateTestAddressFormData(&form); | 1271 test::CreateTestAddressFormData(&form); |
| 1254 std::vector<FormData> forms(1, form); | 1272 std::vector<FormData> forms(1, form); |
| 1255 FormsSeen(forms); | 1273 FormsSeen(forms); |
| 1256 | 1274 |
| 1257 FormFieldData field; | 1275 FormFieldData field; |
| (...skipping 4255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5513 | 5531 |
| 5514 // The driver should always be notified. | 5532 // The driver should always be notified. |
| 5515 for (const FormFieldData& field : form.fields) { | 5533 for (const FormFieldData& field : form.fields) { |
| 5516 GetAutofillSuggestions(form, field); | 5534 GetAutofillSuggestions(form, field); |
| 5517 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); | 5535 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); |
| 5518 autofill_driver_->ClearDidInteractWithCreditCardForm(); | 5536 autofill_driver_->ClearDidInteractWithCreditCardForm(); |
| 5519 } | 5537 } |
| 5520 } | 5538 } |
| 5521 | 5539 |
| 5522 } // namespace autofill | 5540 } // namespace autofill |
| OLD | NEW |