| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 2216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 | 2227 |
| 2228 FormData form; | 2228 FormData form; |
| 2229 EXPECT_TRUE(WebFormElementToFormData(web_form, WebFormControlElement(), | 2229 EXPECT_TRUE(WebFormElementToFormData(web_form, WebFormControlElement(), |
| 2230 EXTRACT_NONE, &form, nullptr)); | 2230 EXTRACT_NONE, &form, nullptr)); |
| 2231 | 2231 |
| 2232 const std::vector<FormFieldData>& fields = form.fields; | 2232 const std::vector<FormFieldData>& fields = form.fields; |
| 2233 ASSERT_EQ(1U, fields.size()); | 2233 ASSERT_EQ(1U, fields.size()); |
| 2234 EXPECT_EQ(ASCIIToUTF16("firstname"), fields[0].name); | 2234 EXPECT_EQ(ASCIIToUTF16("firstname"), fields[0].name); |
| 2235 } | 2235 } |
| 2236 | 2236 |
| 2237 // TODO(crbug.com/616730) Flaky. |
| 2238 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) |
| 2239 #define MAYBE_WebFormElementToFormDataTooManyFields \ |
| 2240 DISABLED_WebFormElementToFormDataTooManyFields |
| 2241 #else |
| 2242 #define MAYBE_WebFormElementToFormDataTooManyFields \ |
| 2243 WebFormElementToFormDataTooManyFields |
| 2244 #endif |
| 2237 // We should not be able to serialize a form with too many fillable fields. | 2245 // We should not be able to serialize a form with too many fillable fields. |
| 2238 TEST_F(FormAutofillTest, WebFormElementToFormDataTooManyFields) { | 2246 TEST_F(FormAutofillTest, MAYBE_WebFormElementToFormDataTooManyFields) { |
| 2239 std::string html = | 2247 std::string html = |
| 2240 "<FORM name='TestForm' action='http://cnn.com' method='post'>"; | 2248 "<FORM name='TestForm' action='http://cnn.com' method='post'>"; |
| 2241 for (size_t i = 0; i < (kMaxParseableFields + 1); ++i) { | 2249 for (size_t i = 0; i < (kMaxParseableFields + 1); ++i) { |
| 2242 html += "<INPUT type='text'/>"; | 2250 html += "<INPUT type='text'/>"; |
| 2243 } | 2251 } |
| 2244 html += "</FORM>"; | 2252 html += "</FORM>"; |
| 2245 LoadHTML(html.c_str()); | 2253 LoadHTML(html.c_str()); |
| 2246 | 2254 |
| 2247 WebFrame* frame = GetMainFrame(); | 2255 WebFrame* frame = GetMainFrame(); |
| 2248 ASSERT_NE(nullptr, frame); | 2256 ASSERT_NE(nullptr, frame); |
| (...skipping 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4574 | 4582 |
| 4575 if (test_case.has_extracted_form) { | 4583 if (test_case.has_extracted_form) { |
| 4576 EXPECT_EQ(test_case.is_form_tag, forms[0].is_form_tag); | 4584 EXPECT_EQ(test_case.is_form_tag, forms[0].is_form_tag); |
| 4577 EXPECT_EQ(test_case.is_formless_checkout, forms[0].is_formless_checkout); | 4585 EXPECT_EQ(test_case.is_formless_checkout, forms[0].is_formless_checkout); |
| 4578 } | 4586 } |
| 4579 } | 4587 } |
| 4580 } | 4588 } |
| 4581 | 4589 |
| 4582 } // namespace form_util | 4590 } // namespace form_util |
| 4583 } // namespace autofill | 4591 } // namespace autofill |
| OLD | NEW |