| Index: mojom/mojom_parser/serialization/serialization_test.go
|
| diff --git a/mojom/mojom_parser/serialization/serialization_test.go b/mojom/mojom_parser/serialization/serialization_test.go
|
| index ad81314295a6fd6aae28cac587ff599fc1a85ba3..f8457b98eccc815ce4cb680490b17e15673a9fc5 100644
|
| --- a/mojom/mojom_parser/serialization/serialization_test.go
|
| +++ b/mojom/mojom_parser/serialization/serialization_test.go
|
| @@ -445,8 +445,7 @@ func TestSingleFileSerialization(t *testing.T) {
|
|
|
| // interface EchoService
|
| test.expectedGraph().ResolvedTypes["TYPE_KEY:test.EchoService"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{
|
| - DeclData: test.newDeclData("EchoService", "test.EchoService"),
|
| - InterfaceName: "EchoService",
|
| + DeclData: test.newDeclData("EchoService", "test.EchoService"),
|
| Methods: map[uint32]mojom_types.MojomMethod{
|
| 0: mojom_types.MojomMethod{
|
| DeclData: test.newDeclData("EchoString", ""),
|
| @@ -502,6 +501,58 @@ func TestSingleFileSerialization(t *testing.T) {
|
| }
|
|
|
| ////////////////////////////////////////////////////////////
|
| + // Test Case: Use of the ServiceName attribute
|
| + ////////////////////////////////////////////////////////////
|
| + {
|
| +
|
| + contents := `
|
| + module test;
|
| +
|
| + [ServiceName = "my.test.EchoService"]
|
| + interface EchoService {
|
| + EchoString(string? value) => (string? value);
|
| + };`
|
| +
|
| + test.addTestCase("test", contents)
|
| +
|
| + // DeclaredMojomObjects
|
| + test.expectedFile().DeclaredMojomObjects.Interfaces = &[]string{"TYPE_KEY:test.EchoService"}
|
| +
|
| + // ResolvedTypes
|
| +
|
| + // interface EchoService
|
| + test.expectedGraph().ResolvedTypes["TYPE_KEY:test.EchoService"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{
|
| + DeclData: test.newDeclDataA("EchoService", "test.EchoService", &[]mojom_types.Attribute{{"ServiceName", &mojom_types.LiteralValueStringValue{"my.test.EchoService"}}}),
|
| + ServiceName: stringPointer("my.test.EchoService"),
|
| + Methods: map[uint32]mojom_types.MojomMethod{
|
| + 0: mojom_types.MojomMethod{
|
| + DeclData: test.newDeclData("EchoString", ""),
|
| + Parameters: mojom_types.MojomStruct{
|
| + DeclData: test.newDeclData("EchoString-request", ""),
|
| + Fields: []mojom_types.StructField{
|
| + mojom_types.StructField{
|
| + DeclData: test.newDeclData("value", ""),
|
| + Type: &mojom_types.TypeStringType{mojom_types.StringType{true}},
|
| + },
|
| + },
|
| + },
|
| + ResponseParams: &mojom_types.MojomStruct{
|
| + DeclData: test.newDeclData("EchoString-response", ""),
|
| + Fields: []mojom_types.StructField{
|
| + mojom_types.StructField{
|
| + DeclData: test.newDeclData("value", ""),
|
| + Type: &mojom_types.TypeStringType{mojom_types.StringType{true}},
|
| + },
|
| + },
|
| + },
|
| + },
|
| + },
|
| + }}
|
| +
|
| + test.endTestCase()
|
| + }
|
| +
|
| + ////////////////////////////////////////////////////////////
|
| // Test Case: Integer constants
|
| ////////////////////////////////////////////////////////////
|
| {
|
|
|