| /* |
| * Copyright (C) 2020 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| syntax = "proto2"; |
| |
| package protozero.test.protos; |
| |
| message RealFakeEvent { |
| optional uint32 base_int = 1; |
| optional string base_string = 2; |
| |
| extensions 10 to 99; |
| } |
| |
| message SystemA { |
| optional uint32 int_a = 1; |
| optional string string_a = 2; |
| } |
| |
| message SystemB { |
| optional uint32 int_b = 1; |
| optional string string_b = 2; |
| } |
| |
| // Dummy message used for naming purposes. |
| message BrowserExtension { |
| extend RealFakeEvent { |
| optional SystemA extension_a = 10; |
| optional SystemB extension_b = 11; |
| } |
| } |
| |
| // Scalar extensions (exercise non-message FindFieldByName paths). |
| message ScalarBrowserExtension { |
| extend RealFakeEvent { |
| optional uint32 ext_uint = 12; |
| optional string ext_string = 13; |
| optional bool ext_bool = 14; |
| } |
| } |
| |
| // File-scope extend (no enclosing wrapper). |
| extend RealFakeEvent { |
| optional uint32 file_scope_ext = 15; |
| } |
| |
| // "Legacy" message with the same format as BrowserExtension. Tests that if |
| // LegacyFakeEvent is split into RealFakeEvent and BrowserExtension, the wire |
| // format remains compatible. |
| message LegacyFakeEvent { |
| optional uint32 base_int = 1; |
| optional string base_string = 2; |
| optional SystemA extension_a = 10; |
| optional SystemB extension_b = 11; |
| } |