Commit 239e4113 authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

[Autofill] Move legacy server request/response protos to be test only


Bug: 1114655
Change-Id: If1f6a68aa8f42b4e5df16b862022f5547ac08b1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2442733
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813342}
parent 47b27a9e
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "components/autofill/core/browser/proto/api_v1.pb.h" #include "components/autofill/core/browser/proto/api_v1.pb.h"
#include "components/autofill/core/browser/proto/legacy_server_request_response.pb.h"
#include "components/autofill/core/browser/proto/server.pb.h" #include "components/autofill/core/browser/proto/server.pb.h"
#include "content/public/test/url_loader_interceptor.h" #include "content/public/test/url_loader_interceptor.h"
#include "third_party/protobuf/src/google/protobuf/stubs/statusor.h" #include "third_party/protobuf/src/google/protobuf/stubs/statusor.h"
......
...@@ -502,7 +502,10 @@ static_library("test_support") { ...@@ -502,7 +502,10 @@ static_library("test_support") {
"webdata/mock_autofill_webdata_service.h", "webdata/mock_autofill_webdata_service.h",
] ]
public_deps = [ ":browser" ] public_deps = [
":browser",
"//components/autofill/core/browser/proto:test_support",
]
deps = [ deps = [
":autofill_address_rewriter_resources", ":autofill_address_rewriter_resources",
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "components/autofill/core/browser/field_types.h" #include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/form_structure.h" #include "components/autofill/core/browser/form_structure.h"
#include "components/autofill/core/browser/proto/api_v1.pb.h" #include "components/autofill/core/browser/proto/api_v1.pb.h"
#include "components/autofill/core/browser/proto/legacy_server_request_response.pb.h"
#include "components/autofill/core/browser/proto/server.pb.h" #include "components/autofill/core/browser/proto/server.pb.h"
class PrefService; class PrefService;
......
...@@ -14,3 +14,8 @@ fuzzable_proto_library("proto") { ...@@ -14,3 +14,8 @@ fuzzable_proto_library("proto") {
"strike_data.proto", "strike_data.proto",
] ]
} }
fuzzable_proto_library("test_support") {
testonly = true
sources = [ "legacy_server_request_response.proto" ]
}
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Data models of request and response to interface with legacy Autofill API.
// Should be used only in tests.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package autofill;
import "password_requirements.proto";
import "server.proto";
// Request to query field suggestions for forms in a page from legacy Autofill
// API.
// Next available id: 15
message AutofillQueryContents {
reserved 11; // Reserved for server use.
required string client_version = 1;
repeated group Form = 2 {
required fixed64 signature = 3;
optional AutofillRandomizedFormMetadata form_metadata = 12;
repeated group Field = 4 {
required fixed32 signature = 5;
optional string name = 8;
optional string type = 9; // Control type.
optional AutofillRandomizedFieldMetadata field_metadata = 13;
}
}
repeated int64 experiments = 14;
}
// Response from Autofill query on the legacy API that gives field suggestions
// for forms of a page in a flattened representation. The fields are returned in
// the exact same order as filled in the request.
// Next available id: 10
message AutofillQueryResponseContents {
optional bool upload_required = 1 [deprecated = true];
repeated group Field = 2 {
required fixed32 overall_type_prediction = 3;
// Detailed list of all possible predictions (including
// |overall_type_prediction| as the first item).
message FieldPrediction {
// The predicted field type.
optional fixed32 type = 1;
// True if the serverside classification believes that the field
// may be pre-filled with a placeholder in the value attribute.
optional bool may_use_prefilled_placeholder = 2;
}
repeated FieldPrediction predictions = 7;
// For fields of type NEW_PASSWORD and ACCOUNT_CREATION_PASSWORD, this may
// specify requirements for the generation of passwords.
optional PasswordRequirementsSpec password_requirements = 9;
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Data models to interface with legacy Autofill API. // Data models to interface with both legacy and Autofill API v1 servers.
syntax = "proto2"; syntax = "proto2";
...@@ -12,51 +12,6 @@ package autofill; ...@@ -12,51 +12,6 @@ package autofill;
import "password_requirements.proto"; import "password_requirements.proto";
// Request to query field suggestions for forms in a page from legacy Autofill
// API.
// Next available id: 15
message AutofillQueryContents {
reserved 11; // Reserved for server use.
required string client_version = 1;
repeated group Form = 2 {
required fixed64 signature = 3;
optional AutofillRandomizedFormMetadata form_metadata = 12;
repeated group Field = 4 {
required fixed32 signature = 5;
optional string name = 8;
optional string type = 9; // Control type.
optional AutofillRandomizedFieldMetadata field_metadata = 13;
}
}
repeated int64 experiments = 14;
}
// Response from Autofill query on the legacy API that gives field suggestions
// for forms of a page in a flattened representation. The fields are returned in
// the exact same order as filled in the request.
// Next available id: 10
message AutofillQueryResponseContents {
optional bool upload_required = 1 [deprecated = true];
repeated group Field = 2 {
required fixed32 overall_type_prediction = 3;
// Detailed list of all possible predictions (including
// |overall_type_prediction| as the first item).
message FieldPrediction {
// The predicted field type.
optional fixed32 type = 1;
// True if the serverside classification believes that the field
// may be pre-filled with a placeholder in the value attribute.
optional bool may_use_prefilled_placeholder = 2;
}
repeated FieldPrediction predictions = 7;
// For fields of type NEW_PASSWORD and ACCOUNT_CREATION_PASSWORD, this may
// specify requirements for the generation of passwords.
optional PasswordRequirementsSpec password_requirements = 9;
}
}
// This message contains a randomized encoding of a string, where each bit // This message contains a randomized encoding of a string, where each bit
// in the encoded string is randomly sent as either the true value seen by // in the encoded string is randomly sent as either the true value seen by
// the client, or random noise. The mapping of specific bits in the encoded // the client, or random noise. The mapping of specific bits in the encoded
......
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