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/form_structure.h" | 5 #include "components/autofill/core/browser/form_structure.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2429 AutofillUploadContents::Field* upload_password_field = upload.add_field(); | 2429 AutofillUploadContents::Field* upload_password_field = upload.add_field(); |
2430 test::FillUploadField(upload_password_field, 2051817934U, "password", | 2430 test::FillUploadField(upload_password_field, 2051817934U, "password", |
2431 "password", "email", 76U); | 2431 "password", "email", 76U); |
2432 upload_password_field->set_form_classifier_outcome( | 2432 upload_password_field->set_form_classifier_outcome( |
2433 AutofillUploadContents::Field::GENERATION_ELEMENT); | 2433 AutofillUploadContents::Field::GENERATION_ELEMENT); |
2434 upload_password_field->set_generation_type( | 2434 upload_password_field->set_generation_type( |
2435 AutofillUploadContents::Field:: | 2435 AutofillUploadContents::Field:: |
2436 MANUALLY_TRIGGERED_GENERATION_ON_SIGN_UP_FORM); | 2436 MANUALLY_TRIGGERED_GENERATION_ON_SIGN_UP_FORM); |
2437 upload_password_field->set_properties_mask(FieldPropertiesFlags::HAD_FOCUS | | 2437 upload_password_field->set_properties_mask(FieldPropertiesFlags::HAD_FOCUS | |
2438 FieldPropertiesFlags::USER_TYPED); | 2438 FieldPropertiesFlags::USER_TYPED); |
| 2439 upload_password_field->set_generated_password_changed(true); |
2439 | 2440 |
2440 std::string expected_upload_string; | 2441 std::string expected_upload_string; |
2441 ASSERT_TRUE(upload.SerializeToString(&expected_upload_string)); | 2442 ASSERT_TRUE(upload.SerializeToString(&expected_upload_string)); |
2442 | 2443 |
2443 AutofillUploadContents encoded_upload; | 2444 AutofillUploadContents encoded_upload; |
2444 EXPECT_TRUE(form_structure->EncodeUploadRequest(available_field_types, true, | 2445 EXPECT_TRUE(form_structure->EncodeUploadRequest(available_field_types, true, |
2445 "42", true, &encoded_upload)); | 2446 "42", true, &encoded_upload)); |
2446 | 2447 |
2447 std::string encoded_upload_string; | 2448 std::string encoded_upload_string; |
2448 encoded_upload.SerializeToString(&encoded_upload_string); | 2449 encoded_upload.SerializeToString(&encoded_upload_string); |
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3848 prefix = FormStructure::FindLongestCommonPrefix(strings); | 3849 prefix = FormStructure::FindLongestCommonPrefix(strings); |
3849 EXPECT_EQ(ASCIIToUTF16("1234567890123456"), prefix); | 3850 EXPECT_EQ(ASCIIToUTF16("1234567890123456"), prefix); |
3850 | 3851 |
3851 // Empty vector. | 3852 // Empty vector. |
3852 strings.clear(); | 3853 strings.clear(); |
3853 prefix = FormStructure::FindLongestCommonPrefix(strings); | 3854 prefix = FormStructure::FindLongestCommonPrefix(strings); |
3854 EXPECT_EQ(ASCIIToUTF16(""), prefix); | 3855 EXPECT_EQ(ASCIIToUTF16(""), prefix); |
3855 } | 3856 } |
3856 | 3857 |
3857 } // namespace autofill | 3858 } // namespace autofill |
OLD | NEW |