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

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

Issue 1059393002: Remove --respect-autocomplete-off-autofill flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix last 3 tests Created 5 years, 8 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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // fillable field. 123 // fillable field.
124 field.label = ASCIIToUTF16("address1"); 124 field.label = ASCIIToUTF16("address1");
125 field.name = ASCIIToUTF16("address1"); 125 field.name = ASCIIToUTF16("address1");
126 field.form_control_type = "text"; 126 field.form_control_type = "text";
127 field.should_autocomplete = false; 127 field.should_autocomplete = false;
128 form.fields.push_back(field); 128 form.fields.push_back(field);
129 129
130 form_structure.reset(new FormStructure(form)); 130 form_structure.reset(new FormStructure(form));
131 form_structure->DetermineHeuristicTypes(); 131 form_structure->DetermineHeuristicTypes();
132 EXPECT_EQ(4U, form_structure->autofill_count()); 132 EXPECT_EQ(4U, form_structure->autofill_count());
133
134 base::CommandLine::ForCurrentProcess()->AppendSwitch(
135 switches::kRespectAutocompleteOffForAutofill);
136
137 form_structure.reset(new FormStructure(form));
138 form_structure->DetermineHeuristicTypes();
139 EXPECT_EQ(3U, form_structure->autofill_count());
140 } 133 }
141 134
142 TEST(FormStructureTest, SourceURL) { 135 TEST(FormStructureTest, SourceURL) {
143 FormData form; 136 FormData form;
144 form.origin = GURL("http://www.foo.com/"); 137 form.origin = GURL("http://www.foo.com/");
145 FormStructure form_structure(form); 138 FormStructure form_structure(form);
146 139
147 EXPECT_EQ(form.origin, form_structure.source_url()); 140 EXPECT_EQ(form.origin, form_structure.source_url());
148 } 141 }
149 142
(...skipping 2315 matching lines...) Expand 10 before | Expand all | Expand 10 after
2465 "</autofillqueryresponse>"; 2458 "</autofillqueryresponse>";
2466 2459
2467 FormStructure::ParseQueryResponse(response, forms.get()); 2460 FormStructure::ParseQueryResponse(response, forms.get());
2468 2461
2469 ASSERT_GE(forms[0]->field_count(), 2U); 2462 ASSERT_GE(forms[0]->field_count(), 2U);
2470 EXPECT_EQ(NO_SERVER_DATA, forms[0]->field(0)->server_type()); 2463 EXPECT_EQ(NO_SERVER_DATA, forms[0]->field(0)->server_type());
2471 EXPECT_EQ(76, forms[0]->field(1)->server_type()); 2464 EXPECT_EQ(76, forms[0]->field(1)->server_type());
2472 } 2465 }
2473 2466
2474 } // namespace autofill 2467 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698