Commit 9e367128 authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

[Autofill] Create the new request proto in FormStructure

Before this patch:
The old query proto was created first and then converted to the new
proto.

After this patch:
The new query proto is created directly

Bug: 1114655
Change-Id: I08255787e05f99622d9ead139cd932ced1b4a87f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2429407Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810697}
parent 6c0322a3
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
#include "components/autofill/core/browser/autofill_metrics.h" #include "components/autofill/core/browser/autofill_metrics.h"
#include "components/autofill/core/browser/logging/log_manager.h" #include "components/autofill/core/browser/logging/log_manager.h"
#include "components/autofill/core/browser/logging/log_protobufs.h" #include "components/autofill/core/browser/logging/log_protobufs.h"
#include "components/autofill/core/browser/proto/legacy_proto_bridge.h" #include "components/autofill/core/browser/proto/api_v1.pb.h"
#include "components/autofill/core/browser/proto/server.pb.h"
#include "components/autofill/core/common/autofill_clock.h" #include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_features.h" #include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_internals/log_message.h" #include "components/autofill/core/common/autofill_internals/log_message.h"
...@@ -324,16 +323,16 @@ const char* RequestTypeToString(AutofillDownloadManager::RequestType type) { ...@@ -324,16 +323,16 @@ const char* RequestTypeToString(AutofillDownloadManager::RequestType type) {
} }
std::ostream& operator<<(std::ostream& out, std::ostream& operator<<(std::ostream& out,
const autofill::AutofillQueryContents& query) { const autofill::AutofillPageQueryRequest& query) {
out << "client_version: " << query.client_version(); out << "client_version: " << query.client_version();
for (const auto& form : query.form()) { for (const auto& form : query.forms()) {
out << "\nForm\n signature: " << form.signature(); out << "\nForm\n signature: " << form.signature();
for (const auto& field : form.field()) { for (const auto& field : form.fields()) {
out << "\n Field\n signature: " << field.signature(); out << "\n Field\n signature: " << field.signature();
if (!field.name().empty()) if (!field.name().empty())
out << "\n name: " << field.name(); out << "\n name: " << field.name();
if (!field.type().empty()) if (!field.control_type().empty())
out << "\n type: " << field.type(); out << "\n type: " << field.control_type();
} }
} }
return out; return out;
...@@ -560,13 +559,12 @@ bool GetAPIBodyPayload(const std::string& payload, ...@@ -560,13 +559,12 @@ bool GetAPIBodyPayload(const std::string& payload,
} }
// Gets the data payload for API Query (POST and GET). // Gets the data payload for API Query (POST and GET).
bool GetAPIQueryPayload(const AutofillQueryContents& query, bool GetAPIQueryPayload(const AutofillPageQueryRequest& query,
std::string* payload) { std::string* payload) {
std::string serialized_query; std::string serialized_query;
if (!CreateApiRequestFromLegacyRequest(query).SerializeToString( if (!query.SerializeToString(&serialized_query))
&serialized_query)) {
return false; return false;
}
base::Base64UrlEncode(serialized_query, base::Base64UrlEncode(serialized_query,
base::Base64UrlEncodePolicy::INCLUDE_PADDING, payload); base::Base64UrlEncodePolicy::INCLUDE_PADDING, payload);
return true; return true;
...@@ -627,7 +625,7 @@ bool AutofillDownloadManager::StartQueryRequest( ...@@ -627,7 +625,7 @@ bool AutofillDownloadManager::StartQueryRequest(
return false; return false;
// Encode the query for the requested forms. // Encode the query for the requested forms.
AutofillQueryContents query; AutofillPageQueryRequest query;
FormAndFieldSignatures signatures; FormAndFieldSignatures signatures;
if (!FormStructure::EncodeQueryRequest(forms, &query, &signatures)) { if (!FormStructure::EncodeQueryRequest(forms, &query, &signatures)) {
return false; return false;
......
...@@ -758,7 +758,7 @@ bool FormStructure::EncodeUploadRequest( ...@@ -758,7 +758,7 @@ bool FormStructure::EncodeUploadRequest(
// static // static
bool FormStructure::EncodeQueryRequest( bool FormStructure::EncodeQueryRequest(
const std::vector<FormStructure*>& forms, const std::vector<FormStructure*>& forms,
AutofillQueryContents* query, AutofillPageQueryRequest* query,
FormAndFieldSignatures* encoded_signatures) { FormAndFieldSignatures* encoded_signatures) {
DCHECK(encoded_signatures); DCHECK(encoded_signatures);
encoded_signatures->clear(); encoded_signatures->clear();
...@@ -782,7 +782,7 @@ bool FormStructure::EncodeQueryRequest( ...@@ -782,7 +782,7 @@ bool FormStructure::EncodeQueryRequest(
if (form->IsMalformed()) if (form->IsMalformed())
continue; continue;
form->EncodeFormForQuery(query->add_form(), encoded_signatures); form->EncodeFormForQuery(query->add_forms(), encoded_signatures);
} }
return !encoded_signatures->empty(); return !encoded_signatures->empty();
...@@ -1964,7 +1964,7 @@ void FormStructure::RationalizeFieldTypePredictions() { ...@@ -1964,7 +1964,7 @@ void FormStructure::RationalizeFieldTypePredictions() {
} }
void FormStructure::EncodeFormForQuery( void FormStructure::EncodeFormForQuery(
AutofillQueryContents::Form* query_form, AutofillPageQueryRequest::Form* query_form,
FormAndFieldSignatures* encoded_signatures) const { FormAndFieldSignatures* encoded_signatures) const {
DCHECK(!IsMalformed()); DCHECK(!IsMalformed());
...@@ -1973,24 +1973,24 @@ void FormStructure::EncodeFormForQuery( ...@@ -1973,24 +1973,24 @@ void FormStructure::EncodeFormForQuery(
encoded_signatures->back().first = form_signature(); encoded_signatures->back().first = form_signature();
if (is_rich_query_enabled_) { if (is_rich_query_enabled_) {
EncodeFormMetadataForQuery(*this, query_form->mutable_form_metadata()); EncodeFormMetadataForQuery(*this, query_form->mutable_metadata());
} }
for (const auto& field : fields_) { for (const auto& field : fields_) {
if (ShouldSkipField(*field)) if (ShouldSkipField(*field))
continue; continue;
AutofillQueryContents::Form::Field* added_field = query_form->add_field(); AutofillPageQueryRequest::Form::Field* added_field =
query_form->add_fields();
added_field->set_signature(field->GetFieldSignature().value()); added_field->set_signature(field->GetFieldSignature().value());
encoded_signatures->back().second.push_back(field->GetFieldSignature()); encoded_signatures->back().second.push_back(field->GetFieldSignature());
if (is_rich_query_enabled_) { if (is_rich_query_enabled_) {
EncodeFieldMetadataForQuery(*field, EncodeFieldMetadataForQuery(*field, added_field->mutable_metadata());
added_field->mutable_field_metadata());
} }
if (IsAutofillFieldMetadataEnabled()) { if (IsAutofillFieldMetadataEnabled()) {
added_field->set_type(field->form_control_type); added_field->set_control_type(field->form_control_type);
if (!field->name.empty()) if (!field->name.empty())
added_field->set_name(base::UTF16ToUTF8(field->name)); added_field->set_name(base::UTF16ToUTF8(field->name));
......
...@@ -87,7 +87,7 @@ class FormStructure { ...@@ -87,7 +87,7 @@ class FormStructure {
// FormStructures have the same FormSignature, only the first one is included // FormStructures have the same FormSignature, only the first one is included
// in |query| and |encoded_signatures|. // in |query| and |encoded_signatures|.
static bool EncodeQueryRequest(const std::vector<FormStructure*>& forms, static bool EncodeQueryRequest(const std::vector<FormStructure*>& forms,
autofill::AutofillQueryContents* query, autofill::AutofillPageQueryRequest* query,
FormAndFieldSignatures* encoded_signatures); FormAndFieldSignatures* encoded_signatures);
// Parses `payload` as AutofillQueryResponse proto and calls // Parses `payload` as AutofillQueryResponse proto and calls
...@@ -524,7 +524,7 @@ class FormStructure { ...@@ -524,7 +524,7 @@ class FormStructure {
// when it considers necessary. // when it considers necessary.
void RationalizeFieldTypePredictions(); void RationalizeFieldTypePredictions();
void EncodeFormForQuery(autofill::AutofillQueryContents::Form* query_form, void EncodeFormForQuery(autofill::AutofillPageQueryRequest::Form* query_form,
FormAndFieldSignatures* encoded_signatures) const; FormAndFieldSignatures* encoded_signatures) const;
void EncodeFormForUpload(autofill::AutofillUploadContents* upload, void EncodeFormForUpload(autofill::AutofillUploadContents* upload,
......
...@@ -2329,26 +2329,26 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) { ...@@ -2329,26 +2329,26 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) {
}}); }});
// Prepare the expected proto string. // Prepare the expected proto string.
AutofillQueryContents query; AutofillPageQueryRequest query;
query.set_client_version("6.1.1715.1442/en (GGLL)"); query.set_client_version("6.1.1715.1442/en (GGLL)");
AutofillQueryContents::Form* query_form = query.add_form(); AutofillPageQueryRequest::Form* query_form = query.add_forms();
query_form->set_signature(form_structure.form_signature().value()); query_form->set_signature(form_structure.form_signature().value());
test::FillQueryField(query_form->add_field(), 412125936U, "name_on_card", test::FillQueryField(query_form->add_fields(), 412125936U, "name_on_card",
"text"); "text");
test::FillQueryField(query_form->add_field(), 1917667676U, "billing_address", test::FillQueryField(query_form->add_fields(), 1917667676U, "billing_address",
"text"); "text");
test::FillQueryField(query_form->add_field(), 2226358947U, "card_number", test::FillQueryField(query_form->add_fields(), 2226358947U, "card_number",
"text"); "text");
test::FillQueryField(query_form->add_field(), 747221617U, "expiration_month", test::FillQueryField(query_form->add_fields(), 747221617U, "expiration_month",
"text"); "text");
test::FillQueryField(query_form->add_field(), 4108155786U, "expiration_year", test::FillQueryField(query_form->add_fields(), 4108155786U, "expiration_year",
"text"); "text");
std::string expected_query_string; std::string expected_query_string;
ASSERT_TRUE(query.SerializeToString(&expected_query_string)); ASSERT_TRUE(query.SerializeToString(&expected_query_string));
AutofillQueryContents encoded_query; AutofillPageQueryRequest encoded_query;
FormAndFieldSignatures encoded_signatures; FormAndFieldSignatures encoded_signatures;
ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query, ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query,
&encoded_signatures)); &encoded_signatures));
...@@ -2365,7 +2365,7 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) { ...@@ -2365,7 +2365,7 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) {
FormAndFieldSignatures expected_signatures2 = expected_signatures; FormAndFieldSignatures expected_signatures2 = expected_signatures;
AutofillQueryContents encoded_query2; AutofillPageQueryRequest encoded_query2;
FormAndFieldSignatures encoded_signatures2; FormAndFieldSignatures encoded_signatures2;
ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query2, ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query2,
&encoded_signatures2)); &encoded_signatures2));
...@@ -2400,27 +2400,27 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) { ...@@ -2400,27 +2400,27 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) {
form_structure3.field(10)->GetFieldSignature()}}); form_structure3.field(10)->GetFieldSignature()}});
// Add the second form to the expected proto. // Add the second form to the expected proto.
query_form = query.add_form(); query_form = query.add_forms();
query_form->set_signature(form_structure3.form_signature().value()); query_form->set_signature(form_structure3.form_signature().value());
test::FillQueryField(query_form->add_field(), 412125936U, "name_on_card", test::FillQueryField(query_form->add_fields(), 412125936U, "name_on_card",
"text"); "text");
test::FillQueryField(query_form->add_field(), 1917667676U, "billing_address", test::FillQueryField(query_form->add_fields(), 1917667676U, "billing_address",
"text"); "text");
test::FillQueryField(query_form->add_field(), 2226358947U, "card_number", test::FillQueryField(query_form->add_fields(), 2226358947U, "card_number",
"text"); "text");
test::FillQueryField(query_form->add_field(), 747221617U, "expiration_month", test::FillQueryField(query_form->add_fields(), 747221617U, "expiration_month",
"text"); "text");
test::FillQueryField(query_form->add_field(), 4108155786U, "expiration_year", test::FillQueryField(query_form->add_fields(), 4108155786U, "expiration_year",
"text"); "text");
for (int i = 0; i < 5; ++i) { for (int i = 0; i < 5; ++i) {
test::FillQueryField(query_form->add_field(), 509334676U, "address", test::FillQueryField(query_form->add_fields(), 509334676U, "address",
"text"); "text");
} }
ASSERT_TRUE(query.SerializeToString(&expected_query_string)); ASSERT_TRUE(query.SerializeToString(&expected_query_string));
AutofillQueryContents encoded_query3; AutofillPageQueryRequest encoded_query3;
FormAndFieldSignatures encoded_signatures3; FormAndFieldSignatures encoded_signatures3;
ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query3, ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query3,
&encoded_signatures3)); &encoded_signatures3));
...@@ -2437,7 +2437,7 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) { ...@@ -2437,7 +2437,7 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) {
FormAndFieldSignatures expected_signatures4 = expected_signatures3; FormAndFieldSignatures expected_signatures4 = expected_signatures3;
AutofillQueryContents encoded_query4; AutofillPageQueryRequest encoded_query4;
FormAndFieldSignatures encoded_signatures4; FormAndFieldSignatures encoded_signatures4;
ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query4, ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query4,
&encoded_signatures4)); &encoded_signatures4));
...@@ -2460,7 +2460,7 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) { ...@@ -2460,7 +2460,7 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) {
FormAndFieldSignatures expected_signatures5 = expected_signatures4; FormAndFieldSignatures expected_signatures5 = expected_signatures4;
AutofillQueryContents encoded_query5; AutofillPageQueryRequest encoded_query5;
FormAndFieldSignatures encoded_signatures5; FormAndFieldSignatures encoded_signatures5;
ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query5, ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query5,
&encoded_signatures5)); &encoded_signatures5));
...@@ -2472,7 +2472,7 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) { ...@@ -2472,7 +2472,7 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest) {
// Check that we fail if there are only bad form(s). // Check that we fail if there are only bad form(s).
std::vector<FormStructure*> bad_forms; std::vector<FormStructure*> bad_forms;
bad_forms.push_back(&malformed_form_structure); bad_forms.push_back(&malformed_form_structure);
AutofillQueryContents encoded_query6; AutofillPageQueryRequest encoded_query6;
FormAndFieldSignatures encoded_signatures6; FormAndFieldSignatures encoded_signatures6;
EXPECT_FALSE(FormStructure::EncodeQueryRequest(bad_forms, &encoded_query6, EXPECT_FALSE(FormStructure::EncodeQueryRequest(bad_forms, &encoded_query6,
&encoded_signatures6)); &encoded_signatures6));
...@@ -4891,16 +4891,17 @@ TEST_F(FormStructureTestImpl, SkipFieldTest) { ...@@ -4891,16 +4891,17 @@ TEST_F(FormStructureTestImpl, SkipFieldTest) {
std::vector<FormStructure*> forms; std::vector<FormStructure*> forms;
forms.push_back(&form_structure); forms.push_back(&form_structure);
FormAndFieldSignatures encoded_signatures; FormAndFieldSignatures encoded_signatures;
AutofillQueryContents encoded_query; AutofillPageQueryRequest encoded_query;
// Create the expected query and serialize it to a string. // Create the expected query and serialize it to a string.
AutofillQueryContents query; AutofillPageQueryRequest query;
query.set_client_version("6.1.1715.1442/en (GGLL)"); query.set_client_version("6.1.1715.1442/en (GGLL)");
AutofillQueryContents::Form* query_form = query.add_form(); AutofillPageQueryRequest::Form* query_form = query.add_forms();
query_form->set_signature(form_structure.form_signature().value()); query_form->set_signature(form_structure.form_signature().value());
test::FillQueryField(query_form->add_field(), 239111655U, "username", "text"); test::FillQueryField(query_form->add_fields(), 239111655U, "username",
test::FillQueryField(query_form->add_field(), 420638584U, "email", "text"); "text");
test::FillQueryField(query_form->add_fields(), 420638584U, "email", "text");
std::string expected_query_string; std::string expected_query_string;
ASSERT_TRUE(query.SerializeToString(&expected_query_string)); ASSERT_TRUE(query.SerializeToString(&expected_query_string));
...@@ -4943,17 +4944,18 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest_WithLabels) { ...@@ -4943,17 +4944,18 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest_WithLabels) {
FormStructure form_structure(form); FormStructure form_structure(form);
forms.push_back(&form_structure); forms.push_back(&form_structure);
FormAndFieldSignatures encoded_signatures; FormAndFieldSignatures encoded_signatures;
AutofillQueryContents encoded_query; AutofillPageQueryRequest encoded_query;
// Create the expected query and serialize it to a string. // Create the expected query and serialize it to a string.
AutofillQueryContents query; AutofillPageQueryRequest query;
query.set_client_version("6.1.1715.1442/en (GGLL)"); query.set_client_version("6.1.1715.1442/en (GGLL)");
AutofillQueryContents::Form* query_form = query.add_form(); AutofillPageQueryRequest::Form* query_form = query.add_forms();
query_form->set_signature(form_structure.form_signature().value()); query_form->set_signature(form_structure.form_signature().value());
test::FillQueryField(query_form->add_field(), 239111655U, "username", "text"); test::FillQueryField(query_form->add_fields(), 239111655U, "username",
test::FillQueryField(query_form->add_field(), 420638584U, "email", "text"); "text");
test::FillQueryField(query_form->add_field(), 2051817934U, "password", test::FillQueryField(query_form->add_fields(), 420638584U, "email", "text");
test::FillQueryField(query_form->add_fields(), 2051817934U, "password",
"password"); "password");
std::string expected_query_string; std::string expected_query_string;
...@@ -4998,17 +5000,18 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest_WithLongLabels) { ...@@ -4998,17 +5000,18 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest_WithLongLabels) {
std::vector<FormStructure*> forms; std::vector<FormStructure*> forms;
forms.push_back(&form_structure); forms.push_back(&form_structure);
FormAndFieldSignatures encoded_signatures; FormAndFieldSignatures encoded_signatures;
AutofillQueryContents encoded_query; AutofillPageQueryRequest encoded_query;
// Create the expected query and serialize it to a string. // Create the expected query and serialize it to a string.
AutofillQueryContents query; AutofillPageQueryRequest query;
query.set_client_version("6.1.1715.1442/en (GGLL)"); query.set_client_version("6.1.1715.1442/en (GGLL)");
AutofillQueryContents::Form* query_form = query.add_form(); AutofillPageQueryRequest::Form* query_form = query.add_forms();
query_form->set_signature(form_structure.form_signature().value()); query_form->set_signature(form_structure.form_signature().value());
test::FillQueryField(query_form->add_field(), 239111655U, "username", "text"); test::FillQueryField(query_form->add_fields(), 239111655U, "username",
test::FillQueryField(query_form->add_field(), 420638584U, "email", "text"); "text");
test::FillQueryField(query_form->add_field(), 2051817934U, "password", test::FillQueryField(query_form->add_fields(), 420638584U, "email", "text");
test::FillQueryField(query_form->add_fields(), 2051817934U, "password",
"password"); "password");
std::string expected_query_string; std::string expected_query_string;
...@@ -5047,16 +5050,17 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest_MissingNames) { ...@@ -5047,16 +5050,17 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest_MissingNames) {
std::vector<FormStructure*> forms; std::vector<FormStructure*> forms;
forms.push_back(&form_structure); forms.push_back(&form_structure);
FormAndFieldSignatures encoded_signatures; FormAndFieldSignatures encoded_signatures;
AutofillQueryContents encoded_query; AutofillPageQueryRequest encoded_query;
// Create the expected query and serialize it to a string. // Create the expected query and serialize it to a string.
AutofillQueryContents query; AutofillPageQueryRequest query;
query.set_client_version("6.1.1715.1442/en (GGLL)"); query.set_client_version("6.1.1715.1442/en (GGLL)");
AutofillQueryContents::Form* query_form = query.add_form(); AutofillPageQueryRequest::Form* query_form = query.add_forms();
query_form->set_signature(form_structure.form_signature().value()); query_form->set_signature(form_structure.form_signature().value());
test::FillQueryField(query_form->add_field(), 239111655U, "username", "text"); test::FillQueryField(query_form->add_fields(), 239111655U, "username",
test::FillQueryField(query_form->add_field(), 1318412689U, nullptr, "text"); "text");
test::FillQueryField(query_form->add_fields(), 1318412689U, nullptr, "text");
std::string expected_query_string; std::string expected_query_string;
ASSERT_TRUE(query.SerializeToString(&expected_query_string)); ASSERT_TRUE(query.SerializeToString(&expected_query_string));
...@@ -5098,16 +5102,16 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest_DisabledMetadataTrial) { ...@@ -5098,16 +5102,16 @@ TEST_F(FormStructureTestImpl, EncodeQueryRequest_DisabledMetadataTrial) {
std::vector<FormStructure*> forms; std::vector<FormStructure*> forms;
forms.push_back(&form_structure); forms.push_back(&form_structure);
FormAndFieldSignatures encoded_signatures; FormAndFieldSignatures encoded_signatures;
AutofillQueryContents encoded_query; AutofillPageQueryRequest encoded_query;
// Create the expected query and serialize it to a string. // Create the expected query and serialize it to a string.
AutofillQueryContents query; AutofillPageQueryRequest query;
query.set_client_version("6.1.1715.1442/en (GGLL)"); query.set_client_version("6.1.1715.1442/en (GGLL)");
AutofillQueryContents::Form* query_form = query.add_form(); AutofillPageQueryRequest::Form* query_form = query.add_forms();
query_form->set_signature(form_structure.form_signature().value()); query_form->set_signature(form_structure.form_signature().value());
test::FillQueryField(query_form->add_field(), 239111655U, nullptr, nullptr); test::FillQueryField(query_form->add_fields(), 239111655U, nullptr, nullptr);
test::FillQueryField(query_form->add_field(), 3654076265U, nullptr, nullptr); test::FillQueryField(query_form->add_fields(), 3654076265U, nullptr, nullptr);
std::string expected_query_string; std::string expected_query_string;
ASSERT_TRUE(query.SerializeToString(&expected_query_string)); ASSERT_TRUE(query.SerializeToString(&expected_query_string));
...@@ -7661,7 +7665,7 @@ TEST_F(FormStructureTestImpl, AllowBigForms) { ...@@ -7661,7 +7665,7 @@ TEST_F(FormStructureTestImpl, AllowBigForms) {
forms.push_back(&form_structure); forms.push_back(&form_structure);
FormAndFieldSignatures encoded_signatures; FormAndFieldSignatures encoded_signatures;
AutofillQueryContents encoded_query; AutofillPageQueryRequest encoded_query;
ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query, ASSERT_TRUE(FormStructure::EncodeQueryRequest(forms, &encoded_query,
&encoded_signatures)); &encoded_signatures));
EXPECT_EQ(1u, encoded_signatures.size()); EXPECT_EQ(1u, encoded_signatures.size());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment