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

Unified Diff: components/autofill/core/browser/form_structure_unittest.cc

Issue 1457793002: [Autofill] No longer pass FormStructure pointers in ParseQueryResponse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added AutofillManager tests Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/core/browser/form_structure.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/form_structure_unittest.cc
diff --git a/components/autofill/core/browser/form_structure_unittest.cc b/components/autofill/core/browser/form_structure_unittest.cc
index 2b63178d863cba96a928ac38543a3f3cd344fa1b..df94ed79f145ebfac0ac87d95c64d3dff38a0dff 100644
--- a/components/autofill/core/browser/form_structure_unittest.cc
+++ b/components/autofill/core/browser/form_structure_unittest.cc
@@ -1483,7 +1483,6 @@ TEST_F(FormStructureTest, EncodeQueryRequest) {
ScopedVector<FormStructure> forms;
forms.push_back(new FormStructure(form));
std::vector<std::string> encoded_signatures;
- std::vector<FormStructure*> queried_forms;
std::string encoded_xml;
const char kSignature1[] = "11337937696949187602";
const char kResponse1[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
@@ -1498,21 +1497,18 @@ TEST_F(FormStructureTest, EncodeQueryRequest) {
"<field signature=\"4108155786\" name=\"expiration_year\" type=\"text\""
" label=\"Expiration Year\"/></form></autofillquery>";
ASSERT_TRUE(FormStructure::EncodeQueryRequest(
- forms.get(), &encoded_signatures, &queried_forms, &encoded_xml));
+ forms.get(), &encoded_signatures, &encoded_xml));
ASSERT_EQ(1U, encoded_signatures.size());
EXPECT_EQ(kSignature1, encoded_signatures[0]);
- EXPECT_EQ(forms[0], queried_forms[0]);
EXPECT_EQ(kResponse1, encoded_xml);
// Add the same form, only one will be encoded, so EncodeQueryRequest() should
// return the same data.
forms.push_back(new FormStructure(form));
ASSERT_TRUE(FormStructure::EncodeQueryRequest(
- forms.get(), &encoded_signatures, &queried_forms, &encoded_xml));
+ forms.get(), &encoded_signatures, &encoded_xml));
ASSERT_EQ(1U, encoded_signatures.size());
EXPECT_EQ(kSignature1, encoded_signatures[0]);
- ASSERT_EQ(1U, queried_forms.size());
- EXPECT_EQ(forms[0], queried_forms[0]);
EXPECT_EQ(kResponse1, encoded_xml);
// Add 5 address fields - this should be still a valid form.
for (size_t i = 0; i < 5; ++i) {
@@ -1523,7 +1519,7 @@ TEST_F(FormStructureTest, EncodeQueryRequest) {
forms.push_back(new FormStructure(form));
ASSERT_TRUE(FormStructure::EncodeQueryRequest(
- forms.get(), &encoded_signatures, &queried_forms, &encoded_xml));
+ forms.get(), &encoded_signatures, &encoded_xml));
ASSERT_EQ(2U, encoded_signatures.size());
EXPECT_EQ(kSignature1, encoded_signatures[0]);
const char kSignature2[] = "8308881815906226214";
@@ -1567,22 +1563,18 @@ TEST_F(FormStructureTest, EncodeQueryRequest) {
forms.push_back(new FormStructure(malformed_form));
ASSERT_TRUE(FormStructure::EncodeQueryRequest(
- forms.get(), &encoded_signatures, &queried_forms, &encoded_xml));
+ forms.get(), &encoded_signatures, &encoded_xml));
ASSERT_EQ(2U, encoded_signatures.size());
EXPECT_EQ(kSignature1, encoded_signatures[0]);
EXPECT_EQ(kSignature2, encoded_signatures[1]);
- ASSERT_EQ(2U, queried_forms.size());
- EXPECT_EQ(forms[0], queried_forms[0]);
- EXPECT_EQ(forms[2], queried_forms[1]);
EXPECT_EQ(kResponse2, encoded_xml);
// Check that we fail if there are only bad form(s).
ScopedVector<FormStructure> bad_forms;
bad_forms.push_back(new FormStructure(malformed_form));
EXPECT_FALSE(FormStructure::EncodeQueryRequest(
- bad_forms.get(), &encoded_signatures, &queried_forms, &encoded_xml));
+ bad_forms.get(), &encoded_signatures, &encoded_xml));
EXPECT_EQ(0U, encoded_signatures.size());
- EXPECT_EQ(0U, queried_forms.size());
EXPECT_EQ("", encoded_xml);
}
@@ -2769,7 +2761,6 @@ TEST_F(FormStructureTest, SkipFieldTest) {
ScopedVector<FormStructure> forms;
forms.push_back(new FormStructure(form));
std::vector<std::string> encoded_signatures;
- std::vector<FormStructure*> queried_forms;
std::string encoded_xml;
const char kSignature[] = "18006745212084723782";
@@ -2781,10 +2772,9 @@ TEST_F(FormStructureTest, SkipFieldTest) {
"<field signature=\"420638584\" name=\"email\" type=\"text\"/>"
"</form></autofillquery>";
ASSERT_TRUE(FormStructure::EncodeQueryRequest(
- forms.get(), &encoded_signatures, &queried_forms, &encoded_xml));
+ forms.get(), &encoded_signatures, &encoded_xml));
ASSERT_EQ(1U, encoded_signatures.size());
EXPECT_EQ(kSignature, encoded_signatures[0]);
- EXPECT_EQ(forms[0], queried_forms[0]);
EXPECT_EQ(kResponse, encoded_xml);
}
@@ -2813,7 +2803,6 @@ TEST_F(FormStructureTest, EncodeQueryRequest_WithLabels) {
ScopedVector<FormStructure> forms;
forms.push_back(new FormStructure(form));
std::vector<std::string> encoded_signatures;
- std::vector<FormStructure*> queried_forms;
std::string encoded_xml;
const char kRequest[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
@@ -2825,7 +2814,7 @@ TEST_F(FormStructureTest, EncodeQueryRequest_WithLabels) {
"<field signature=\"2051817934\" name=\"password\" type=\"password\""
" label=\"Enter your Password\"/></form></autofillquery>";
EXPECT_TRUE(FormStructure::EncodeQueryRequest(
- forms.get(), &encoded_signatures, &queried_forms, &encoded_xml));
+ forms.get(), &encoded_signatures, &encoded_xml));
EXPECT_EQ(kRequest, encoded_xml);
}
@@ -2859,7 +2848,6 @@ TEST_F(FormStructureTest, EncodeQueryRequest_WithLongLabels) {
ScopedVector<FormStructure> forms;
forms.push_back(new FormStructure(form));
std::vector<std::string> encoded_signatures;
- std::vector<FormStructure*> queried_forms;
std::string encoded_xml;
const char kRequest[] =
@@ -2875,7 +2863,7 @@ TEST_F(FormStructureTest, EncodeQueryRequest_WithLongLabels) {
"<field signature=\"2051817934\" name=\"password\" type=\"password\""
" label=\"Enter your Password\"/></form></autofillquery>";
EXPECT_TRUE(FormStructure::EncodeQueryRequest(
- forms.get(), &encoded_signatures, &queried_forms, &encoded_xml));
+ forms.get(), &encoded_signatures, &encoded_xml));
EXPECT_EQ(kRequest, encoded_xml);
}
@@ -2902,7 +2890,6 @@ TEST_F(FormStructureTest, EncodeQueryRequest_MissingNames) {
ScopedVector<FormStructure> forms;
forms.push_back(new FormStructure(form));
std::vector<std::string> encoded_signatures;
- std::vector<FormStructure*> queried_forms;
std::string encoded_xml;
const char kSignature[] = "16416961345885087496";
@@ -2913,10 +2900,9 @@ TEST_F(FormStructureTest, EncodeQueryRequest_MissingNames) {
" label=\"username\"/><field signature=\"1318412689\" type=\"text\"/>"
"</form></autofillquery>";
ASSERT_TRUE(FormStructure::EncodeQueryRequest(
- forms.get(), &encoded_signatures, &queried_forms, &encoded_xml));
+ forms.get(), &encoded_signatures, &encoded_xml));
ASSERT_EQ(1U, encoded_signatures.size());
EXPECT_EQ(kSignature, encoded_signatures[0]);
- EXPECT_EQ(forms[0], queried_forms[0]);
EXPECT_EQ(kResponse, encoded_xml);
}
@@ -2944,7 +2930,6 @@ TEST_F(FormStructureTest, EncodeQueryRequest_DisabledMetadataTrial) {
ScopedVector<FormStructure> forms;
forms.push_back(new FormStructure(form));
std::vector<std::string> encoded_signatures;
- std::vector<FormStructure*> queried_forms;
std::string encoded_xml;
const char kSignature[] = "7635954436925888745";
@@ -2955,10 +2940,9 @@ TEST_F(FormStructureTest, EncodeQueryRequest_DisabledMetadataTrial) {
"<field signature=\"3654076265\"/>"
"</form></autofillquery>";
ASSERT_TRUE(FormStructure::EncodeQueryRequest(
- forms.get(), &encoded_signatures, &queried_forms, &encoded_xml));
+ forms.get(), &encoded_signatures, &encoded_xml));
ASSERT_EQ(1U, encoded_signatures.size());
EXPECT_EQ(kSignature, encoded_signatures[0]);
- EXPECT_EQ(forms[0], queried_forms[0]);
EXPECT_EQ(kResponse, encoded_xml);
}
« no previous file with comments | « components/autofill/core/browser/form_structure.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698