Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: chrome/renderer/autofill/password_generation_test_utils.cc

Issue 2318533002: [Password Generation] Use signatures for form matching (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/autofill/content/public/cpp/autofill_types_struct_traits.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/renderer/autofill/password_generation_test_utils.h" 5 #include "chrome/renderer/autofill/password_generation_test_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "components/autofill/content/renderer/form_autofill_util.h" 10 #include "components/autofill/content/renderer/form_autofill_util.h"
11 #include "components/autofill/content/renderer/test_password_generation_agent.h" 11 #include "components/autofill/content/renderer/test_password_generation_agent.h"
12 #include "components/autofill/core/common/password_form_generation_data.h" 12 #include "components/autofill/core/common/password_form_generation_data.h"
13 #include "components/autofill/core/common/signatures_util.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 #include "third_party/WebKit/public/web/WebDocument.h" 15 #include "third_party/WebKit/public/web/WebDocument.h"
15 #include "third_party/WebKit/public/web/WebFormElement.h" 16 #include "third_party/WebKit/public/web/WebFormElement.h"
16 17
17 namespace autofill { 18 namespace autofill {
18 19
19 void SetNotBlacklistedMessage(TestPasswordGenerationAgent* generation_agent, 20 void SetNotBlacklistedMessage(TestPasswordGenerationAgent* generation_agent,
20 const char* form_str) { 21 const char* form_str) {
21 autofill::PasswordForm form; 22 autofill::PasswordForm form;
22 form.origin = form_util::StripAuthAndParams( 23 form.origin = form_util::StripAuthAndParams(
(...skipping 11 matching lines...) Expand all
34 blink::WebVector<blink::WebFormElement> web_forms; 35 blink::WebVector<blink::WebFormElement> web_forms;
35 document.forms(web_forms); 36 document.forms(web_forms);
36 37
37 autofill::FormData form_data; 38 autofill::FormData form_data;
38 WebFormElementToFormData( 39 WebFormElementToFormData(
39 web_forms[form_index], blink::WebFormControlElement(), nullptr, 40 web_forms[form_index], blink::WebFormControlElement(), nullptr,
40 form_util::EXTRACT_NONE, &form_data, nullptr /* FormFieldData */); 41 form_util::EXTRACT_NONE, &form_data, nullptr /* FormFieldData */);
41 42
42 std::vector<autofill::PasswordFormGenerationData> forms; 43 std::vector<autofill::PasswordFormGenerationData> forms;
43 forms.push_back(autofill::PasswordFormGenerationData{ 44 forms.push_back(autofill::PasswordFormGenerationData{
44 form_data.name, form_util::StripAuthAndParams(form_data.action), 45 CalculateFormSignature(form_data),
45 form_data.fields[field_index]}); 46 CalculateFieldSignatureForField(form_data.fields[field_index])});
46 generation_agent->FoundFormsEligibleForGeneration(forms); 47 generation_agent->FoundFormsEligibleForGeneration(forms);
47 } 48 }
48 49
49 } // namespace autofill 50 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/content/public/cpp/autofill_types_struct_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698