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

Unified Diff: mojom/mojom_parser/serialization/serialization_test.go

Issue 1677343002: mojom_types.mojom: Changes the name |interface_name| to |service_name| in struct MojomInterface. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Responds to code review. Created 4 years, 10 months 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 | « mojom/mojom_parser/serialization/serialization.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
////////////////////////////////////////////////////////////
{
« no previous file with comments | « mojom/mojom_parser/serialization/serialization.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698