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

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

Issue 2421383003: Add operator==(const GURL&, const StringPiece&) to gurl.h (Closed)
Patch Set: remove comment Created 4 years, 2 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 (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 4434 matching lines...) Expand 10 before | Expand all | Expand 10 after
4445 frame->document().all(), &fieldsets); 4445 frame->document().all(), &fieldsets);
4446 ASSERT_EQ(3U, control_elements.size()); 4446 ASSERT_EQ(3U, control_elements.size());
4447 ASSERT_EQ(2U, fieldsets.size()); 4447 ASSERT_EQ(2U, fieldsets.size());
4448 4448
4449 FormData form; 4449 FormData form;
4450 EXPECT_TRUE(UnownedCheckoutFormElementsAndFieldSetsToFormData( 4450 EXPECT_TRUE(UnownedCheckoutFormElementsAndFieldSetsToFormData(
4451 fieldsets, control_elements, nullptr, frame->document(), extract_mask, 4451 fieldsets, control_elements, nullptr, frame->document(), extract_mask,
4452 &form, nullptr)); 4452 &form, nullptr));
4453 4453
4454 EXPECT_TRUE(form.name.empty()); 4454 EXPECT_TRUE(form.name.empty());
4455 EXPECT_EQ(frame->document().url(), form.origin); 4455 EXPECT_EQ(GURL(frame->document().url()), form.origin);
4456 EXPECT_FALSE(form.action.is_valid()); 4456 EXPECT_FALSE(form.action.is_valid());
4457 4457
4458 const std::vector<FormFieldData>& fields = form.fields; 4458 const std::vector<FormFieldData>& fields = form.fields;
4459 ASSERT_EQ(3U, fields.size()); 4459 ASSERT_EQ(3U, fields.size());
4460 4460
4461 FormFieldData expected; 4461 FormFieldData expected;
4462 expected.form_control_type = "text"; 4462 expected.form_control_type = "text";
4463 expected.max_length = WebInputElement::defaultMaxLength(); 4463 expected.max_length = WebInputElement::defaultMaxLength();
4464 4464
4465 expected.name = ASCIIToUTF16("firstname"); 4465 expected.name = ASCIIToUTF16("firstname");
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
4505 frame->document().all(), &fieldsets); 4505 frame->document().all(), &fieldsets);
4506 ASSERT_EQ(3U, control_elements.size()); 4506 ASSERT_EQ(3U, control_elements.size());
4507 ASSERT_EQ(1U, fieldsets.size()); 4507 ASSERT_EQ(1U, fieldsets.size());
4508 4508
4509 FormData form; 4509 FormData form;
4510 EXPECT_TRUE(UnownedCheckoutFormElementsAndFieldSetsToFormData( 4510 EXPECT_TRUE(UnownedCheckoutFormElementsAndFieldSetsToFormData(
4511 fieldsets, control_elements, nullptr, frame->document(), extract_mask, 4511 fieldsets, control_elements, nullptr, frame->document(), extract_mask,
4512 &form, nullptr)); 4512 &form, nullptr));
4513 4513
4514 EXPECT_TRUE(form.name.empty()); 4514 EXPECT_TRUE(form.name.empty());
4515 EXPECT_EQ(frame->document().url(), form.origin); 4515 EXPECT_EQ(GURL(frame->document().url()), form.origin);
4516 EXPECT_FALSE(form.action.is_valid()); 4516 EXPECT_FALSE(form.action.is_valid());
4517 4517
4518 const std::vector<FormFieldData>& fields = form.fields; 4518 const std::vector<FormFieldData>& fields = form.fields;
4519 ASSERT_EQ(3U, fields.size()); 4519 ASSERT_EQ(3U, fields.size());
4520 4520
4521 FormFieldData expected; 4521 FormFieldData expected;
4522 expected.form_control_type = "text"; 4522 expected.form_control_type = "text";
4523 expected.max_length = WebInputElement::defaultMaxLength(); 4523 expected.max_length = WebInputElement::defaultMaxLength();
4524 4524
4525 expected.name = ASCIIToUTF16("firstname"); 4525 expected.name = ASCIIToUTF16("firstname");
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
4628 4628
4629 if (test_case.has_extracted_form) { 4629 if (test_case.has_extracted_form) {
4630 EXPECT_EQ(test_case.is_form_tag, forms[0].is_form_tag); 4630 EXPECT_EQ(test_case.is_form_tag, forms[0].is_form_tag);
4631 EXPECT_EQ(test_case.is_formless_checkout, forms[0].is_formless_checkout); 4631 EXPECT_EQ(test_case.is_formless_checkout, forms[0].is_formless_checkout);
4632 } 4632 }
4633 } 4633 }
4634 } 4634 }
4635 4635
4636 } // namespace form_util 4636 } // namespace form_util
4637 } // namespace autofill 4637 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698