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

Side by Side Diff: components/autofill/core/browser/form_structure_unittest.cc

Issue 23432002: Generate passwords only for forms that autofill server marks as account creation forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 7 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
OLDNEW
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 "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "components/autofill/content/browser/autocheckout_page_meta_data.h" 10 #include "components/autofill/content/browser/autocheckout_page_meta_data.h"
(...skipping 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after
2419 form.action = form.origin.Resolve("/login"); 2419 form.action = form.origin.Resolve("/login");
2420 2420
2421 FormFieldData field; 2421 FormFieldData field;
2422 field.label = ASCIIToUTF16("username"); 2422 field.label = ASCIIToUTF16("username");
2423 field.name = ASCIIToUTF16("username"); 2423 field.name = ASCIIToUTF16("username");
2424 field.form_control_type = "text"; 2424 field.form_control_type = "text";
2425 form.fields.push_back(field); 2425 form.fields.push_back(field);
2426 2426
2427 field.label = ASCIIToUTF16("password"); 2427 field.label = ASCIIToUTF16("password");
2428 field.name = ASCIIToUTF16("password"); 2428 field.name = ASCIIToUTF16("password");
2429 field.form_control_type = "password"; 2429 field.form_control_type = "password";
Ilya Sherman 2013/09/03 23:58:01 nit: Please update the field type to be a checkabl
zysxqn 2013/09/04 17:26:20 Done.
2430 field.is_checkable = true;
2430 form.fields.push_back(field); 2431 form.fields.push_back(field);
2431 2432
2432 field.label = base::string16(); 2433 field.label = base::string16();
2433 field.name = ASCIIToUTF16("email"); 2434 field.name = ASCIIToUTF16("email");
2434 field.form_control_type = "text"; 2435 field.form_control_type = "text";
2435 form.fields.push_back(field); 2436 form.fields.push_back(field);
2436 2437
2437 ScopedVector<FormStructure> forms; 2438 ScopedVector<FormStructure> forms;
2438 forms.push_back(new FormStructure(form, std::string())); 2439 forms.push_back(new FormStructure(form, std::string()));
2439 std::vector<std::string> encoded_signatures; 2440 std::vector<std::string> encoded_signatures;
(...skipping 17 matching lines...) Expand all
2457 "<autofillqueryresponse><field autofilltype=\"3\" />" 2458 "<autofillqueryresponse><field autofilltype=\"3\" />"
2458 "<field autofilltype=\"9\" /></autofillqueryresponse>"; 2459 "<field autofilltype=\"9\" /></autofillqueryresponse>";
2459 FormStructure::ParseQueryResponse(kServerResponse, forms.get(), 2460 FormStructure::ParseQueryResponse(kServerResponse, forms.get(),
2460 &page_meta_data, TestAutofillMetrics()); 2461 &page_meta_data, TestAutofillMetrics());
2461 ASSERT_EQ(NAME_FIRST, forms[0]->field(0)->server_type()); 2462 ASSERT_EQ(NAME_FIRST, forms[0]->field(0)->server_type());
2462 ASSERT_EQ(NO_SERVER_DATA, forms[0]->field(1)->server_type()); 2463 ASSERT_EQ(NO_SERVER_DATA, forms[0]->field(1)->server_type());
2463 ASSERT_EQ(EMAIL_ADDRESS, forms[0]->field(2)->server_type()); 2464 ASSERT_EQ(EMAIL_ADDRESS, forms[0]->field(2)->server_type());
2464 } 2465 }
2465 2466
2466 } // namespace autofill 2467 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698