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

Side by Side Diff: mojom/mojom_parser/serialization/serialization_test.go

Issue 1767033002: Mojom parser: Compute and validate struct field ordinals. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Maintain the property that the fields of a module.Struct are sorted in declaration order. Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « mojom/mojom_parser/serialization/serialization.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package serialization 5 package serialization
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "mojo/public/go/bindings" 9 "mojo/public/go/bindings"
10 "mojom/mojom_parser/generated/mojom_files" 10 "mojom/mojom_parser/generated/mojom_files"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 // endTestCase() should be invoked at the end of a case in 66 // endTestCase() should be invoked at the end of a case in
67 // TestSingleFileSerialization. 67 // TestSingleFileSerialization.
68 func (test *singleFileTest) endTestCase() { 68 func (test *singleFileTest) endTestCase() {
69 test.expectedGraph().Files = make(map[string]mojom_files.MojomFile) 69 test.expectedGraph().Files = make(map[string]mojom_files.MojomFile)
70 test.expectedGraph().Files[test.fileName()] = *test.expectedFile() 70 test.expectedGraph().Files[test.fileName()] = *test.expectedFile()
71 test.testCaseNum += 1 71 test.testCaseNum += 1
72 } 72 }
73 73
74 // newShortDeclData constructs a new DeclarationData with the given data. 74 // newShortDeclDataO constructs a new DeclarationData with the given data.
75 func (test *singleFileTest) newShortDeclData(shortName string) *mojom_types.Decl arationData { 75 func (test *singleFileTest) newShortDeclData(shortName string) *mojom_types.Decl arationData {
76 declData := test.newContainedDeclData(shortName, "", nil) 76 declData := test.newContainedDeclData(shortName, "", nil)
77 declData.FullIdentifier = nil 77 declData.FullIdentifier = nil
78 return declData 78 return declData
79 } 79 }
80 80
81 // newShortDeclDataO constructs a new DeclarationData with the given data.
82 func (test *singleFileTest) newShortDeclDataO(declarationOrder, declaredOrdinal int32, shortName string) *mojom_types.DeclarationData {
83 declData := test.newContainedDeclDataA(declarationOrder, declaredOrdinal , shortName, "", nil, nil)
84 declData.FullIdentifier = nil
85 return declData
86 }
87
81 // newDeclData constructs a new DeclarationData with the given data. 88 // newDeclData constructs a new DeclarationData with the given data.
82 func (test *singleFileTest) newDeclData(shortName, fullIdentifier string) *mojom _types.DeclarationData { 89 func (test *singleFileTest) newDeclData(shortName, fullIdentifier string) *mojom _types.DeclarationData {
83 return test.newContainedDeclData(shortName, fullIdentifier, nil) 90 return test.newContainedDeclData(shortName, fullIdentifier, nil)
84 } 91 }
85 92
93 // newDeclData constructs a new DeclarationData with the given data.
94 func (test *singleFileTest) newDeclDataO(declarationOrder, declaredOrdinal int32 , shortName, fullIdentifier string) *mojom_types.DeclarationData {
95 return test.newContainedDeclDataA(declarationOrder, declaredOrdinal, sho rtName, fullIdentifier, nil, nil)
96 }
97
86 // newDeclDataA constructs a new DeclarationData with the given data, including attributes. 98 // newDeclDataA constructs a new DeclarationData with the given data, including attributes.
87 func (test *singleFileTest) newDeclDataA(shortName, fullIdentifier string, 99 func (test *singleFileTest) newDeclDataA(shortName, fullIdentifier string,
88 attributes *[]mojom_types.Attribute) *mojom_types.DeclarationData { 100 attributes *[]mojom_types.Attribute) *mojom_types.DeclarationData {
89 » return test.newContainedDeclDataA(shortName, fullIdentifier, nil, attrib utes) 101 » return test.newContainedDeclDataA(-1, -1, shortName, fullIdentifier, nil , attributes)
90 } 102 }
91 103
92 // newShortDeclDataA constructs a new DeclarationData with the given data, inclu ding attributes. 104 // newShortDeclDataA constructs a new DeclarationData with the given data, inclu ding attributes.
93 func (test *singleFileTest) newShortDeclDataA(shortName string, 105 func (test *singleFileTest) newShortDeclDataA(shortName string,
94 attributes *[]mojom_types.Attribute) *mojom_types.DeclarationData { 106 attributes *[]mojom_types.Attribute) *mojom_types.DeclarationData {
95 » declData := test.newContainedDeclDataA(shortName, "", nil, attributes) 107 » declData := test.newContainedDeclDataA(-1, -1, shortName, "", nil, attri butes)
108 » declData.FullIdentifier = nil
109 » return declData
110 }
111
112 // newShortDeclDataA constructs a new DeclarationData with the given data, inclu ding attributes.
113 func (test *singleFileTest) newShortDeclDataAO(declarationOrder, declaredOrdinal int32, shortName string,
114 » attributes *[]mojom_types.Attribute) *mojom_types.DeclarationData {
115 » declData := test.newContainedDeclDataA(declarationOrder, declaredOrdinal , shortName, "", nil, attributes)
96 declData.FullIdentifier = nil 116 declData.FullIdentifier = nil
97 return declData 117 return declData
98 } 118 }
99 119
100 // newContainedDeclData constructs a new DeclarationData with the given data. 120 // newContainedDeclData constructs a new DeclarationData with the given data.
101 func (test *singleFileTest) newContainedDeclData(shortName, fullIdentifier strin g, containerTypeKey *string) *mojom_types.DeclarationData { 121 func (test *singleFileTest) newContainedDeclData(shortName, fullIdentifier strin g, containerTypeKey *string) *mojom_types.DeclarationData {
102 » return test.newContainedDeclDataA(shortName, fullIdentifier, containerTy peKey, nil) 122 » return test.newContainedDeclDataA(-1, -1, shortName, fullIdentifier, con tainerTypeKey, nil)
103 } 123 }
104 124
105 // newContainedDeclDataA constructs a new DeclarationData with the given data, i ncluding attributes. 125 // newContainedDeclDataA constructs a new DeclarationData with the given data, i ncluding attributes.
106 func (test *singleFileTest) newContainedDeclDataA(shortName, fullIdentifier stri ng, 126 func (test *singleFileTest) newContainedDeclDataA(declarationOrder, declaredOrdi nal int32, shortName, fullIdentifier string,
107 containerTypeKey *string, attributes *[]mojom_types.Attribute) *mojom_ty pes.DeclarationData { 127 containerTypeKey *string, attributes *[]mojom_types.Attribute) *mojom_ty pes.DeclarationData {
108 » return newContainedDeclDataA(test.fileName(), shortName, fullIdentifier, containerTypeKey, attributes) 128 » return newContainedDeclDataA(declarationOrder, declaredOrdinal, test.fil eName(), shortName, fullIdentifier, containerTypeKey, attributes)
109 } 129 }
110 130
111 // newDeclData constructs a new DeclarationData with the given data. 131 // newDeclData constructs a new DeclarationData with the given data.
112 func newDeclData(fileName, shortName, fullIdentifier string) *mojom_types.Declar ationData { 132 func newDeclData(fileName, shortName, fullIdentifier string) *mojom_types.Declar ationData {
113 return newContainedDeclData(fileName, shortName, fullIdentifier, nil) 133 return newContainedDeclData(fileName, shortName, fullIdentifier, nil)
114 } 134 }
115 135
136 // newDeclData constructs a new DeclarationData with the given data.
137 func newDeclDataO(declarationOrder, declaredOrdinal int32, fileName, shortName, fullIdentifier string) *mojom_types.DeclarationData {
138 return newContainedDeclDataA(declarationOrder, declaredOrdinal, fileName , shortName, fullIdentifier, nil, nil)
139 }
140
116 // newDeclDataA constructs a new DeclarationData with the given data, including attributes. 141 // newDeclDataA constructs a new DeclarationData with the given data, including attributes.
117 func newDeclDataA(fileName, shortName, fullIdentifier string, 142 func newDeclDataA(fileName, shortName, fullIdentifier string,
118 attributes *[]mojom_types.Attribute) *mojom_types.DeclarationData { 143 attributes *[]mojom_types.Attribute) *mojom_types.DeclarationData {
119 » return newContainedDeclDataA(fileName, shortName, fullIdentifier, nil, a ttributes) 144 » return newContainedDeclDataA(-1, -1, fileName, shortName, fullIdentifier , nil, attributes)
120 } 145 }
121 146
122 // newContainedDeclData constructs a new DeclarationData with the given data. 147 // newContainedDeclData constructs a new DeclarationData with the given data.
123 func newContainedDeclData(fileName, shortName, fullIdentifier string, containerT ypeKey *string) *mojom_types.DeclarationData { 148 func newContainedDeclData(fileName, shortName, fullIdentifier string, containerT ypeKey *string) *mojom_types.DeclarationData {
124 » return newContainedDeclDataA(fileName, shortName, fullIdentifier, contai nerTypeKey, nil) 149 » return newContainedDeclDataA(-1, -1, fileName, shortName, fullIdentifier , containerTypeKey, nil)
125 } 150 }
126 151
127 // newContainedDeclDataA constructs a new DeclarationData with the given data, i ncluding attributes. 152 // newContainedDeclDataA constructs a new DeclarationData with the given data, i ncluding attributes.
128 func newContainedDeclDataA(fileName, shortName, fullIdentifier string, 153 func newContainedDeclDataA(declarationOrder, declaredOrdinal int32, fileName, sh ortName, fullIdentifier string,
129 containerTypeKey *string, attributes *[]mojom_types.Attribute) *mojom_ty pes.DeclarationData { 154 containerTypeKey *string, attributes *[]mojom_types.Attribute) *mojom_ty pes.DeclarationData {
130 var fullyQualifiedName *string 155 var fullyQualifiedName *string
131 if fullIdentifier != "" { 156 if fullIdentifier != "" {
132 fullyQualifiedName = &fullIdentifier 157 fullyQualifiedName = &fullIdentifier
133 } 158 }
134 return &mojom_types.DeclarationData{ 159 return &mojom_types.DeclarationData{
135 Attributes: attributes, 160 Attributes: attributes,
136 ShortName: &shortName, 161 ShortName: &shortName,
137 FullIdentifier: fullyQualifiedName, 162 FullIdentifier: fullyQualifiedName,
138 » » DeclaredOrdinal: -1, 163 » » DeclaredOrdinal: declaredOrdinal,
139 » » DeclarationOrder: -1, 164 » » DeclarationOrder: declarationOrder,
140 ContainerTypeKey: containerTypeKey, 165 ContainerTypeKey: containerTypeKey,
141 SourceFileInfo: &mojom_types.SourceFileInfo{ 166 SourceFileInfo: &mojom_types.SourceFileInfo{
142 FileName: fileName, 167 FileName: fileName,
143 }} 168 }}
144 } 169 }
145 170
146 // TestSingleFileSerialization uses a series of test cases in which the text of a .mojom 171 // TestSingleFileSerialization uses a series of test cases in which the text of a .mojom
147 // file is specified and the expected MojomFileGraph is specified using Go struc t literals. 172 // file is specified and the expected MojomFileGraph is specified using Go struc t literals.
148 func TestSingleFileSerialization(t *testing.T) { 173 func TestSingleFileSerialization(t *testing.T) {
149 test := singleFileTest{} 174 test := singleFileTest{}
150 175
151 //////////////////////////////////////////////////////////// 176 ////////////////////////////////////////////////////////////
177 // Test Case: struct field ordinals
178 ////////////////////////////////////////////////////////////
179 {
180
181 contents := `
182 struct Foo{
183 int32 x@2;
184 int32 y@3;
185 int32 z@0;
186 int32 w@1;
187 };`
188
189 test.addTestCase("", contents)
190
191 // DeclaredMojomObjects
192 test.expectedFile().DeclaredMojomObjects.Structs = &[]string{"TY PE_KEY:Foo"}
193
194 // ResolvedTypes
195
196 // struct Foo
197 test.expectedGraph().ResolvedTypes["TYPE_KEY:Foo"] = &mojom_type s.UserDefinedTypeStructType{mojom_types.MojomStruct{
198 DeclData: test.newDeclData("Foo", "Foo"),
199 Fields: []mojom_types.StructField{
200 // The fields are in ordinal order and the first two arguments to newShortDeclDataO() are
201 // declarationOrder and declaredOrdinal.
202
203 // field z
204 {
205 DeclData: test.newShortDeclDataO(2, 0, " z"),
206 Type: &mojom_types.TypeSimpleType{mo jom_types.SimpleType_InT32},
207 },
208 // field w
209 {
210 DeclData: test.newShortDeclDataO(3, 1, " w"),
211 Type: &mojom_types.TypeSimpleType{mo jom_types.SimpleType_InT32},
212 },
213 // field x
214 {
215 DeclData: test.newShortDeclDataO(0, 2, " x"),
216 Type: &mojom_types.TypeSimpleType{mo jom_types.SimpleType_InT32},
217 },
218 // field y
219 {
220 DeclData: test.newShortDeclDataO(1, 3, " y"),
221 Type: &mojom_types.TypeSimpleType{mo jom_types.SimpleType_InT32},
222 },
223 },
224 }}
225
226 test.endTestCase()
227 }
228
229 ////////////////////////////////////////////////////////////
230 // Test Case: struct field ordinals, some implicit
231 ////////////////////////////////////////////////////////////
232 {
233
234 contents := `
235 struct Foo{
236 int32 x@2;
237 int32 y;
238 int32 z@0;
239 int32 w;
240 };`
241
242 test.addTestCase("", contents)
243
244 // DeclaredMojomObjects
245 test.expectedFile().DeclaredMojomObjects.Structs = &[]string{"TY PE_KEY:Foo"}
246
247 // ResolvedTypes
248
249 // struct Foo
250 test.expectedGraph().ResolvedTypes["TYPE_KEY:Foo"] = &mojom_type s.UserDefinedTypeStructType{mojom_types.MojomStruct{
251 DeclData: test.newDeclData("Foo", "Foo"),
252 Fields: []mojom_types.StructField{
253 // The fields are in ordinal order and the first two arguments to newShortDeclDataO() are
254 // declarationOrder and declaredOrdinal.
255
256 // field z
257 {
258 DeclData: test.newShortDeclDataO(2, 0, " z"),
259 Type: &mojom_types.TypeSimpleType{mo jom_types.SimpleType_InT32},
260 },
261 // field w
262 {
263 DeclData: test.newShortDeclDataO(3, -1, "w"),
264 Type: &mojom_types.TypeSimpleType{mo jom_types.SimpleType_InT32},
265 },
266 // field x
267 {
268 DeclData: test.newShortDeclDataO(0, 2, " x"),
269 Type: &mojom_types.TypeSimpleType{mo jom_types.SimpleType_InT32},
270 },
271 // field y
272 {
273 DeclData: test.newShortDeclDataO(1, -1, "y"),
274 Type: &mojom_types.TypeSimpleType{mo jom_types.SimpleType_InT32},
275 },
276 },
277 }}
278
279 test.endTestCase()
280 }
281
282 ////////////////////////////////////////////////////////////
152 // Test Case: array of int32 283 // Test Case: array of int32
153 //////////////////////////////////////////////////////////// 284 ////////////////////////////////////////////////////////////
154 { 285 {
155 286
156 contents := ` 287 contents := `
157 struct Foo{ 288 struct Foo{
158 array<int32> bar1; 289 array<int32> bar1;
159 array<int32, 7> bar2; 290 array<int32, 7> bar2;
160 array<int32>? bar3; 291 array<int32>? bar3;
161 array<int32, 8>? bar4; 292 array<int32, 8>? bar4;
162 };` 293 };`
163 294
164 test.addTestCase("", contents) 295 test.addTestCase("", contents)
165 296
166 // DeclaredMojomObjects 297 // DeclaredMojomObjects
167 test.expectedFile().DeclaredMojomObjects.Structs = &[]string{"TY PE_KEY:Foo"} 298 test.expectedFile().DeclaredMojomObjects.Structs = &[]string{"TY PE_KEY:Foo"}
168 299
169 // ResolvedTypes 300 // ResolvedTypes
170 301
171 // struct Foo 302 // struct Foo
172 test.expectedGraph().ResolvedTypes["TYPE_KEY:Foo"] = &mojom_type s.UserDefinedTypeStructType{mojom_types.MojomStruct{ 303 test.expectedGraph().ResolvedTypes["TYPE_KEY:Foo"] = &mojom_type s.UserDefinedTypeStructType{mojom_types.MojomStruct{
173 DeclData: test.newDeclData("Foo", "Foo"), 304 DeclData: test.newDeclData("Foo", "Foo"),
174 Fields: []mojom_types.StructField{ 305 Fields: []mojom_types.StructField{
175 // field bar1 is not nullable and not fixed leng th 306 // field bar1 is not nullable and not fixed leng th
176 { 307 {
177 » » » » » DeclData: test.newShortDeclData("bar1"), 308 » » » » » DeclData: test.newShortDeclDataO(0, -1, "bar1"),
178 Type: &mojom_types.TypeArrayType{mojom_t ypes.ArrayType{ 309 Type: &mojom_types.TypeArrayType{mojom_t ypes.ArrayType{
179 false, -1, &mojom_types.TypeSimp leType{mojom_types.SimpleType_InT32}}}, 310 false, -1, &mojom_types.TypeSimp leType{mojom_types.SimpleType_InT32}}},
180 }, 311 },
181 // field bar2 is not nullable and fixed length o f 7 312 // field bar2 is not nullable and fixed length o f 7
182 { 313 {
183 » » » » » DeclData: test.newShortDeclData("bar2"), 314 » » » » » DeclData: test.newShortDeclDataO(1, -1, "bar2"),
184 Type: &mojom_types.TypeArrayType{mojom_t ypes.ArrayType{ 315 Type: &mojom_types.TypeArrayType{mojom_t ypes.ArrayType{
185 false, 7, &mojom_types.TypeSimpl eType{mojom_types.SimpleType_InT32}}}, 316 false, 7, &mojom_types.TypeSimpl eType{mojom_types.SimpleType_InT32}}},
186 }, 317 },
187 // field bar3 is nullable and not fixed length 318 // field bar3 is nullable and not fixed length
188 { 319 {
189 » » » » » DeclData: test.newShortDeclData("bar3"), 320 » » » » » DeclData: test.newShortDeclDataO(2, -1, "bar3"),
190 Type: &mojom_types.TypeArrayType{mojom_t ypes.ArrayType{ 321 Type: &mojom_types.TypeArrayType{mojom_t ypes.ArrayType{
191 true, -1, &mojom_types.TypeSimpl eType{mojom_types.SimpleType_InT32}}}, 322 true, -1, &mojom_types.TypeSimpl eType{mojom_types.SimpleType_InT32}}},
192 }, 323 },
193 // field bar4 is nullable and fixed length of 8 324 // field bar4 is nullable and fixed length of 8
194 { 325 {
195 » » » » » DeclData: test.newShortDeclData("bar4"), 326 » » » » » DeclData: test.newShortDeclDataO(3, -1, "bar4"),
196 Type: &mojom_types.TypeArrayType{mojom_t ypes.ArrayType{ 327 Type: &mojom_types.TypeArrayType{mojom_t ypes.ArrayType{
197 true, 8, &mojom_types.TypeSimple Type{mojom_types.SimpleType_InT32}}}, 328 true, 8, &mojom_types.TypeSimple Type{mojom_types.SimpleType_InT32}}},
198 }, 329 },
199 }, 330 },
200 }} 331 }}
201 332
202 test.endTestCase() 333 test.endTestCase()
203 } 334 }
204 335
205 //////////////////////////////////////////////////////////// 336 ////////////////////////////////////////////////////////////
(...skipping 15 matching lines...) Expand all
221 test.expectedFile().DeclaredMojomObjects.Structs = &[]string{"TY PE_KEY:Foo"} 352 test.expectedFile().DeclaredMojomObjects.Structs = &[]string{"TY PE_KEY:Foo"}
222 353
223 // ResolvedTypes 354 // ResolvedTypes
224 355
225 // struct Foo 356 // struct Foo
226 test.expectedGraph().ResolvedTypes["TYPE_KEY:Foo"] = &mojom_type s.UserDefinedTypeStructType{mojom_types.MojomStruct{ 357 test.expectedGraph().ResolvedTypes["TYPE_KEY:Foo"] = &mojom_type s.UserDefinedTypeStructType{mojom_types.MojomStruct{
227 DeclData: test.newDeclData("Foo", "Foo"), 358 DeclData: test.newDeclData("Foo", "Foo"),
228 Fields: []mojom_types.StructField{ 359 Fields: []mojom_types.StructField{
229 // field bar1 is non-nullable with a non-nullabl e key. 360 // field bar1 is non-nullable with a non-nullabl e key.
230 { 361 {
231 » » » » » DeclData: test.newShortDeclData("bar1"), 362 » » » » » DeclData: test.newShortDeclDataO(0, -1, "bar1"),
232 Type: &mojom_types.TypeMapType{mojom_typ es.MapType{ 363 Type: &mojom_types.TypeMapType{mojom_typ es.MapType{
233 false, 364 false,
234 &mojom_types.TypeStringType{mojo m_types.StringType{false}}, 365 &mojom_types.TypeStringType{mojo m_types.StringType{false}},
235 &mojom_types.TypeSimpleType{mojo m_types.SimpleType_InT32}}}, 366 &mojom_types.TypeSimpleType{mojo m_types.SimpleType_InT32}}},
236 }, 367 },
237 // field bar2 is non-nullable with a nullable ke y. 368 // field bar2 is non-nullable with a nullable ke y.
238 { 369 {
239 » » » » » DeclData: test.newShortDeclData("bar2"), 370 » » » » » DeclData: test.newShortDeclDataO(1, -1, "bar2"),
240 Type: &mojom_types.TypeMapType{mojom_typ es.MapType{ 371 Type: &mojom_types.TypeMapType{mojom_typ es.MapType{
241 false, 372 false,
242 &mojom_types.TypeStringType{mojo m_types.StringType{true}}, 373 &mojom_types.TypeStringType{mojo m_types.StringType{true}},
243 &mojom_types.TypeSimpleType{mojo m_types.SimpleType_InT32}}}, 374 &mojom_types.TypeSimpleType{mojo m_types.SimpleType_InT32}}},
244 }, 375 },
245 // field bar3 is nullable with a non-nullable ke y. 376 // field bar3 is nullable with a non-nullable ke y.
246 { 377 {
247 » » » » » DeclData: test.newShortDeclData("bar3"), 378 » » » » » DeclData: test.newShortDeclDataO(2, -1, "bar3"),
248 Type: &mojom_types.TypeMapType{mojom_typ es.MapType{ 379 Type: &mojom_types.TypeMapType{mojom_typ es.MapType{
249 true, 380 true,
250 &mojom_types.TypeStringType{mojo m_types.StringType{false}}, 381 &mojom_types.TypeStringType{mojo m_types.StringType{false}},
251 &mojom_types.TypeSimpleType{mojo m_types.SimpleType_InT32}}}, 382 &mojom_types.TypeSimpleType{mojo m_types.SimpleType_InT32}}},
252 }, 383 },
253 // field bar4 is nullable with a nullable key. 384 // field bar4 is nullable with a nullable key.
254 { 385 {
255 » » » » » DeclData: test.newShortDeclData("bar4"), 386 » » » » » DeclData: test.newShortDeclDataO(3, -1, "bar4"),
256 Type: &mojom_types.TypeMapType{mojom_typ es.MapType{ 387 Type: &mojom_types.TypeMapType{mojom_typ es.MapType{
257 true, 388 true,
258 &mojom_types.TypeStringType{mojo m_types.StringType{true}}, 389 &mojom_types.TypeStringType{mojo m_types.StringType{true}},
259 &mojom_types.TypeSimpleType{mojo m_types.SimpleType_InT32}}}, 390 &mojom_types.TypeSimpleType{mojo m_types.SimpleType_InT32}}},
260 }, 391 },
261 }, 392 },
262 }} 393 }}
263 394
264 test.endTestCase() 395 test.endTestCase()
265 } 396 }
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 DeclarationOrder: -1, 533 DeclarationOrder: -1,
403 SourceFileInfo: &mojom_types.SourceFileInfo{ 534 SourceFileInfo: &mojom_types.SourceFileInfo{
404 FileName: test.fileName(), 535 FileName: test.fileName(),
405 }, 536 },
406 ContainedDeclarations: &mojom_types.ContainedDec larations{ 537 ContainedDeclarations: &mojom_types.ContainedDec larations{
407 Constants: &[]string{"TYPE_KEY:MyStruct. RED"}}, 538 Constants: &[]string{"TYPE_KEY:MyStruct. RED"}},
408 }, 539 },
409 Fields: []mojom_types.StructField{ 540 Fields: []mojom_types.StructField{
410 // field a_color 541 // field a_color
411 { 542 {
412 » » » » » DeclData: test.newShortDeclData("a_color "), 543 » » » » » DeclData: test.newShortDeclDataO(0, -1, "a_color"),
413 Type: &mojom_types.TypeTypeReference{moj om_types.TypeReference{ 544 Type: &mojom_types.TypeTypeReference{moj om_types.TypeReference{
414 false, false, stringPointer("Col or"), stringPointer("TYPE_KEY:Color")}}, 545 false, false, stringPointer("Col or"), stringPointer("TYPE_KEY:Color")}},
415 DefaultValue: &mojom_types.DefaultFieldV alueValue{&mojom_types.ValueUserValueReference{ 546 DefaultValue: &mojom_types.DefaultFieldV alueValue{&mojom_types.ValueUserValueReference{
416 mojom_types.UserValueReference{ 547 mojom_types.UserValueReference{
417 Identifier: "RED", 548 Identifier: "RED",
418 ValueKey: stringPointe r("TYPE_KEY:MyStruct.RED")}}}, // Note this refers to MyStruct.RED and not Color .RED. 549 ValueKey: stringPointe r("TYPE_KEY:MyStruct.RED")}}}, // Note this refers to MyStruct.RED and not Color .RED.
419 }, 550 },
420 }, 551 },
421 }} 552 }}
422 553
(...skipping 23 matching lines...) Expand all
446 // interface EchoService 577 // interface EchoService
447 test.expectedGraph().ResolvedTypes["TYPE_KEY:test.EchoService"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{ 578 test.expectedGraph().ResolvedTypes["TYPE_KEY:test.EchoService"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{
448 DeclData: test.newDeclData("EchoService", "test.EchoServ ice"), 579 DeclData: test.newDeclData("EchoService", "test.EchoServ ice"),
449 Methods: map[uint32]mojom_types.MojomMethod{ 580 Methods: map[uint32]mojom_types.MojomMethod{
450 0: mojom_types.MojomMethod{ 581 0: mojom_types.MojomMethod{
451 DeclData: test.newDeclData("EchoString", ""), 582 DeclData: test.newDeclData("EchoString", ""),
452 Parameters: mojom_types.MojomStruct{ 583 Parameters: mojom_types.MojomStruct{
453 DeclData: test.newDeclData("Echo String-request", ""), 584 DeclData: test.newDeclData("Echo String-request", ""),
454 Fields: []mojom_types.StructFiel d{ 585 Fields: []mojom_types.StructFiel d{
455 mojom_types.StructField{ 586 mojom_types.StructField{
456 » » » » » » » » DeclData: test.n ewDeclData("value", ""), 587 » » » » » » » » DeclData: test.n ewDeclDataO(0, -1, "value", ""),
457 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}}, 588 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}},
458 }, 589 },
459 }, 590 },
460 }, 591 },
461 ResponseParams: &mojom_types.MojomStruct { 592 ResponseParams: &mojom_types.MojomStruct {
462 DeclData: test.newDeclData("Echo String-response", ""), 593 DeclData: test.newDeclData("Echo String-response", ""),
463 Fields: []mojom_types.StructFiel d{ 594 Fields: []mojom_types.StructFiel d{
464 mojom_types.StructField{ 595 mojom_types.StructField{
465 » » » » » » » » DeclData: test.n ewDeclData("value", ""), 596 » » » » » » » » DeclData: test.n ewDeclDataO(0, -1, "value", ""),
466 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}}, 597 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}},
467 }, 598 },
468 }, 599 },
469 }, 600 },
470 }, 601 },
471 1: mojom_types.MojomMethod{ 602 1: mojom_types.MojomMethod{
472 DeclData: test.newDeclData("DelayedEchoS tring", ""), 603 DeclData: test.newDeclData("DelayedEchoS tring", ""),
473 Parameters: mojom_types.MojomStruct{ 604 Parameters: mojom_types.MojomStruct{
474 DeclData: test.newDeclData("Dela yedEchoString-request", ""), 605 DeclData: test.newDeclData("Dela yedEchoString-request", ""),
475 Fields: []mojom_types.StructFiel d{ 606 Fields: []mojom_types.StructFiel d{
476 mojom_types.StructField{ 607 mojom_types.StructField{
477 » » » » » » » » DeclData: test.n ewDeclData("value", ""), 608 » » » » » » » » DeclData: test.n ewDeclDataO(0, -1, "value", ""),
478 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}}, 609 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}},
479 }, 610 },
480 mojom_types.StructField{ 611 mojom_types.StructField{
481 » » » » » » » » DeclData: test.n ewDeclData("millis", ""), 612 » » » » » » » » DeclData: test.n ewDeclDataO(1, -1, "millis", ""),
482 Type: &mojom _types.TypeSimpleType{mojom_types.SimpleType_InT32}, 613 Type: &mojom _types.TypeSimpleType{mojom_types.SimpleType_InT32},
483 }, 614 },
484 }, 615 },
485 }, 616 },
486 ResponseParams: &mojom_types.MojomStruct { 617 ResponseParams: &mojom_types.MojomStruct {
487 DeclData: test.newDeclData("Dela yedEchoString-response", ""), 618 DeclData: test.newDeclData("Dela yedEchoString-response", ""),
488 Fields: []mojom_types.StructFiel d{ 619 Fields: []mojom_types.StructFiel d{
489 mojom_types.StructField{ 620 mojom_types.StructField{
490 » » » » » » » » DeclData: test.n ewDeclData("value", ""), 621 » » » » » » » » DeclData: test.n ewDeclDataO(0, -1, "value", ""),
491 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}}, 622 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}},
492 }, 623 },
493 }, 624 },
494 }, 625 },
495 Ordinal: 1, 626 Ordinal: 1,
496 }, 627 },
497 }, 628 },
498 }} 629 }}
499 630
500 test.endTestCase() 631 test.endTestCase()
(...skipping 23 matching lines...) Expand all
524 test.expectedGraph().ResolvedTypes["TYPE_KEY:test.EchoService"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{ 655 test.expectedGraph().ResolvedTypes["TYPE_KEY:test.EchoService"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{
525 DeclData: test.newDeclDataA("EchoService", "test.Echo Service", &[]mojom_types.Attribute{{"ServiceName", &mojom_types.LiteralValueStri ngValue{"my.test.EchoService"}}}), 656 DeclData: test.newDeclDataA("EchoService", "test.Echo Service", &[]mojom_types.Attribute{{"ServiceName", &mojom_types.LiteralValueStri ngValue{"my.test.EchoService"}}}),
526 ServiceName: stringPointer("my.test.EchoService"), 657 ServiceName: stringPointer("my.test.EchoService"),
527 Methods: map[uint32]mojom_types.MojomMethod{ 658 Methods: map[uint32]mojom_types.MojomMethod{
528 0: mojom_types.MojomMethod{ 659 0: mojom_types.MojomMethod{
529 DeclData: test.newDeclData("EchoString", ""), 660 DeclData: test.newDeclData("EchoString", ""),
530 Parameters: mojom_types.MojomStruct{ 661 Parameters: mojom_types.MojomStruct{
531 DeclData: test.newDeclData("Echo String-request", ""), 662 DeclData: test.newDeclData("Echo String-request", ""),
532 Fields: []mojom_types.StructFiel d{ 663 Fields: []mojom_types.StructFiel d{
533 mojom_types.StructField{ 664 mojom_types.StructField{
534 » » » » » » » » DeclData: test.n ewDeclData("value", ""), 665 » » » » » » » » DeclData: test.n ewDeclDataO(0, -1, "value", ""),
535 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}}, 666 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}},
536 }, 667 },
537 }, 668 },
538 }, 669 },
539 ResponseParams: &mojom_types.MojomStruct { 670 ResponseParams: &mojom_types.MojomStruct {
540 DeclData: test.newDeclData("Echo String-response", ""), 671 DeclData: test.newDeclData("Echo String-response", ""),
541 Fields: []mojom_types.StructFiel d{ 672 Fields: []mojom_types.StructFiel d{
542 mojom_types.StructField{ 673 mojom_types.StructField{
543 » » » » » » » » DeclData: test.n ewDeclData("value", ""), 674 » » » » » » » » DeclData: test.n ewDeclDataO(0, -1, "value", ""),
544 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}}, 675 Type: &mojom _types.TypeStringType{mojom_types.StringType{true}},
545 }, 676 },
546 }, 677 },
547 }, 678 },
548 }, 679 },
549 }, 680 },
550 }} 681 }}
551 682
552 test.endTestCase() 683 test.endTestCase()
553 } 684 }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 DeclarationOrder: -1, 926 DeclarationOrder: -1,
796 SourceFileInfo: &mojom_types.SourceFileInfo{ 927 SourceFileInfo: &mojom_types.SourceFileInfo{
797 FileName: test.fileName(), 928 FileName: test.fileName(),
798 }, 929 },
799 ContainedDeclarations: &mojom_types.ContainedDec larations{ 930 ContainedDeclarations: &mojom_types.ContainedDec larations{
800 Enums: &[]string{"TYPE_KEY:mojom.test.Fo o.Hats"}}, 931 Enums: &[]string{"TYPE_KEY:mojom.test.Fo o.Hats"}},
801 }, 932 },
802 Fields: []mojom_types.StructField{ 933 Fields: []mojom_types.StructField{
803 // field x 934 // field x
804 { 935 {
805 » » » » » DeclData: test.newShortDeclData("x"), 936 » » » » » DeclData: test.newShortDeclDataO(0, -1, "x"),
806 Type: &mojom_types.TypeSimpleType{mo jom_types.SimpleType_InT32}, 937 Type: &mojom_types.TypeSimpleType{mo jom_types.SimpleType_InT32},
807 }, 938 },
808 // field y 939 // field y
809 { 940 {
810 » » » » » DeclData: test.newShortDeclDataA("y" , &[]mojom_types.Attribute{{"min_version", &mojom_types.LiteralValueInt8Value{2} }}), 941 » » » » » DeclData: test.newShortDeclDataAO(1, -1, "y", &[]mojom_types.Attribute{{"min_version", &mojom_types.LiteralValueInt8 Value{2}}}),
811 Type: &mojom_types.TypeStringTyp e{mojom_types.StringType{false}}, 942 Type: &mojom_types.TypeStringTyp e{mojom_types.StringType{false}},
812 DefaultValue: &mojom_types.DefaultFieldV alueValue{&mojom_types.ValueLiteralValue{&mojom_types.LiteralValueStringValue{"h ello"}}}, 943 DefaultValue: &mojom_types.DefaultFieldV alueValue{&mojom_types.ValueLiteralValue{&mojom_types.LiteralValueStringValue{"h ello"}}},
813 }, 944 },
814 // field z 945 // field z
815 { 946 {
816 » » » » » DeclData: test.newShortDeclData("z"), 947 » » » » » DeclData: test.newShortDeclDataO(2, -1, "z"),
817 Type: &mojom_types.TypeStringType{mo jom_types.StringType{true}}, 948 Type: &mojom_types.TypeStringType{mo jom_types.StringType{true}},
818 }, 949 },
819 }, 950 },
820 }} 951 }}
821 952
822 // enum Hats 953 // enum Hats
823 test.expectedGraph().ResolvedTypes["TYPE_KEY:mojom.test.Foo.Hats "] = &mojom_types.UserDefinedTypeEnumType{mojom_types.MojomEnum{ 954 test.expectedGraph().ResolvedTypes["TYPE_KEY:mojom.test.Foo.Hats "] = &mojom_types.UserDefinedTypeEnumType{mojom_types.MojomEnum{
824 DeclData: test.newContainedDeclData("Hats", "mojom.test. Foo.Hats", stringPointer("TYPE_KEY:mojom.test.Foo")), 955 DeclData: test.newContainedDeclData("Hats", "mojom.test. Foo.Hats", stringPointer("TYPE_KEY:mojom.test.Foo")),
825 Values: []mojom_types.EnumValue{ 956 Values: []mojom_types.EnumValue{
826 // Note(rudominer) It is a bug that we need to c opy the enum values here. 957 // Note(rudominer) It is a bug that we need to c opy the enum values here.
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 // InterfaceA 1509 // InterfaceA
1379 test.expectedRuntimeTypeInfoA().TypeMap["TYPE_KEY:a.b.c.Interfac eA"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{ 1510 test.expectedRuntimeTypeInfoA().TypeMap["TYPE_KEY:a.b.c.Interfac eA"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{
1380 DeclData: newDeclData(test.fileNameA(), "InterfaceA", "a .b.c.InterfaceA"), 1511 DeclData: newDeclData(test.fileNameA(), "InterfaceA", "a .b.c.InterfaceA"),
1381 Methods: map[uint32]mojom_types.MojomMethod{ 1512 Methods: map[uint32]mojom_types.MojomMethod{
1382 0: mojom_types.MojomMethod{ 1513 0: mojom_types.MojomMethod{
1383 DeclData: newDeclData(test.fileNameA(), "DoIt", ""), 1514 DeclData: newDeclData(test.fileNameA(), "DoIt", ""),
1384 Parameters: mojom_types.MojomStruct{ 1515 Parameters: mojom_types.MojomStruct{
1385 DeclData: newDeclData(test.fileN ameA(), "DoIt-request", ""), 1516 DeclData: newDeclData(test.fileN ameA(), "DoIt-request", ""),
1386 Fields: []mojom_types.StructFiel d{ 1517 Fields: []mojom_types.StructFiel d{
1387 mojom_types.StructField{ 1518 mojom_types.StructField{
1388 » » » » » » » » DeclData: newDec lData(test.fileNameA(), "x", ""), 1519 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameA(), "x", ""),
1389 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1520 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1390 false, f alse, stringPointer("FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}}, 1521 false, f alse, stringPointer("FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}},
1391 }, 1522 },
1392 }, 1523 },
1393 }, 1524 },
1394 ResponseParams: &mojom_types.MojomStruct { 1525 ResponseParams: &mojom_types.MojomStruct {
1395 DeclData: newDeclData(test.fileN ameA(), "DoIt-response", ""), 1526 DeclData: newDeclData(test.fileN ameA(), "DoIt-response", ""),
1396 Fields: []mojom_types.StructFiel d{ 1527 Fields: []mojom_types.StructFiel d{
1397 mojom_types.StructField{ 1528 mojom_types.StructField{
1398 » » » » » » » » DeclData: newDec lData(test.fileNameA(), "y", ""), 1529 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameA(), "y", ""),
1399 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1530 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1400 true, fa lse, stringPointer("b.c.d.FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}}, 1531 true, fa lse, stringPointer("b.c.d.FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}},
1401 }, 1532 },
1402 }, 1533 },
1403 }, 1534 },
1404 }, 1535 },
1405 }, 1536 },
1406 }} 1537 }}
1407 1538
1408 //////////////////////////////////////////////////////////////// //////// 1539 //////////////////////////////////////////////////////////////// ////////
1409 1540
1410 // TypeMap for file B 1541 // TypeMap for file B
1411 1542
1412 // FooA 1543 // FooA
1413 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.FooB"] = &mojom_types.UserDefinedTypeStructType{mojom_types.MojomStruct{ 1544 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.FooB"] = &mojom_types.UserDefinedTypeStructType{mojom_types.MojomStruct{
1414 DeclData: newDeclData(test.fileNameB(), "FooB", "b.c.d.F ooB"), 1545 DeclData: newDeclData(test.fileNameB(), "FooB", "b.c.d.F ooB"),
1415 Fields: []mojom_types.StructField{}}} 1546 Fields: []mojom_types.StructField{}}}
1416 1547
1417 // InterfaceB 1548 // InterfaceB
1418 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.Interfac eB"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{ 1549 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.Interfac eB"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{
1419 DeclData: newDeclData(test.fileNameB(), "InterfaceB", "b .c.d.InterfaceB"), 1550 DeclData: newDeclData(test.fileNameB(), "InterfaceB", "b .c.d.InterfaceB"),
1420 Methods: map[uint32]mojom_types.MojomMethod{ 1551 Methods: map[uint32]mojom_types.MojomMethod{
1421 0: mojom_types.MojomMethod{ 1552 0: mojom_types.MojomMethod{
1422 DeclData: newDeclData(test.fileNameB(), "DoIt", ""), 1553 DeclData: newDeclData(test.fileNameB(), "DoIt", ""),
1423 Parameters: mojom_types.MojomStruct{ 1554 Parameters: mojom_types.MojomStruct{
1424 DeclData: newDeclData(test.fileN ameB(), "DoIt-request", ""), 1555 DeclData: newDeclData(test.fileN ameB(), "DoIt-request", ""),
1425 Fields: []mojom_types.StructFiel d{ 1556 Fields: []mojom_types.StructFiel d{
1426 mojom_types.StructField{ 1557 mojom_types.StructField{
1427 » » » » » » » » DeclData: newDec lData(test.fileNameB(), "x", ""), 1558 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameB(), "x", ""),
1428 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1559 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1429 false, f alse, stringPointer("a.b.c.FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}}, 1560 false, f alse, stringPointer("a.b.c.FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}},
1430 }, 1561 },
1431 }, 1562 },
1432 }, 1563 },
1433 ResponseParams: &mojom_types.MojomStruct { 1564 ResponseParams: &mojom_types.MojomStruct {
1434 DeclData: newDeclData(test.fileN ameB(), "DoIt-response", ""), 1565 DeclData: newDeclData(test.fileN ameB(), "DoIt-response", ""),
1435 Fields: []mojom_types.StructFiel d{ 1566 Fields: []mojom_types.StructFiel d{
1436 mojom_types.StructField{ 1567 mojom_types.StructField{
1437 » » » » » » » » DeclData: newDec lData(test.fileNameB(), "y", ""), 1568 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameB(), "y", ""),
1438 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1569 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1439 true, fa lse, stringPointer("FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}}, 1570 true, fa lse, stringPointer("FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}},
1440 }, 1571 },
1441 }, 1572 },
1442 }, 1573 },
1443 }, 1574 },
1444 }, 1575 },
1445 }} 1576 }}
1446 1577
1447 test.endTestCase() 1578 test.endTestCase()
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 DeclData: newDeclDataA(test.fileNameA(), "InterfaceA", " a.b.c.InterfaceA", 1624 DeclData: newDeclDataA(test.fileNameA(), "InterfaceA", " a.b.c.InterfaceA",
1494 &[]mojom_types.Attribute{{"ServiceName", &mojom_ types.LiteralValueStringValue{"AwesomeService"}}}), 1625 &[]mojom_types.Attribute{{"ServiceName", &mojom_ types.LiteralValueStringValue{"AwesomeService"}}}),
1495 ServiceName: stringPointer("AwesomeService"), 1626 ServiceName: stringPointer("AwesomeService"),
1496 Methods: map[uint32]mojom_types.MojomMethod{ 1627 Methods: map[uint32]mojom_types.MojomMethod{
1497 0: mojom_types.MojomMethod{ 1628 0: mojom_types.MojomMethod{
1498 DeclData: newDeclData(test.fileNameA(), "DoIt", ""), 1629 DeclData: newDeclData(test.fileNameA(), "DoIt", ""),
1499 Parameters: mojom_types.MojomStruct{ 1630 Parameters: mojom_types.MojomStruct{
1500 DeclData: newDeclData(test.fileN ameA(), "DoIt-request", ""), 1631 DeclData: newDeclData(test.fileN ameA(), "DoIt-request", ""),
1501 Fields: []mojom_types.StructFiel d{ 1632 Fields: []mojom_types.StructFiel d{
1502 mojom_types.StructField{ 1633 mojom_types.StructField{
1503 » » » » » » » » DeclData: newDec lData(test.fileNameA(), "x", ""), 1634 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameA(), "x", ""),
1504 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1635 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1505 false, f alse, stringPointer("FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}}, 1636 false, f alse, stringPointer("FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}},
1506 }, 1637 },
1507 }, 1638 },
1508 }, 1639 },
1509 ResponseParams: &mojom_types.MojomStruct { 1640 ResponseParams: &mojom_types.MojomStruct {
1510 DeclData: newDeclData(test.fileN ameA(), "DoIt-response", ""), 1641 DeclData: newDeclData(test.fileN ameA(), "DoIt-response", ""),
1511 Fields: []mojom_types.StructFiel d{ 1642 Fields: []mojom_types.StructFiel d{
1512 mojom_types.StructField{ 1643 mojom_types.StructField{
1513 » » » » » » » » DeclData: newDec lData(test.fileNameA(), "y", ""), 1644 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameA(), "y", ""),
1514 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1645 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1515 true, fa lse, stringPointer("b.c.d.FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}}, 1646 true, fa lse, stringPointer("b.c.d.FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}},
1516 }, 1647 },
1517 }, 1648 },
1518 }, 1649 },
1519 }, 1650 },
1520 }, 1651 },
1521 }} 1652 }}
1522 1653
1523 //////////////////////////////////////////////////////////////// //////// 1654 //////////////////////////////////////////////////////////////// ////////
1524 1655
1525 // TypeMap for file B 1656 // TypeMap for file B
1526 1657
1527 // FooA 1658 // FooA
1528 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.FooB"] = &mojom_types.UserDefinedTypeStructType{mojom_types.MojomStruct{ 1659 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.FooB"] = &mojom_types.UserDefinedTypeStructType{mojom_types.MojomStruct{
1529 DeclData: newDeclData(test.fileNameB(), "FooB", "b.c.d.F ooB"), 1660 DeclData: newDeclData(test.fileNameB(), "FooB", "b.c.d.F ooB"),
1530 Fields: []mojom_types.StructField{}}} 1661 Fields: []mojom_types.StructField{}}}
1531 1662
1532 // InterfaceB 1663 // InterfaceB
1533 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.Interfac eB"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{ 1664 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.Interfac eB"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{
1534 DeclData: newDeclData(test.fileNameB(), "InterfaceB", "b .c.d.InterfaceB"), 1665 DeclData: newDeclData(test.fileNameB(), "InterfaceB", "b .c.d.InterfaceB"),
1535 Methods: map[uint32]mojom_types.MojomMethod{ 1666 Methods: map[uint32]mojom_types.MojomMethod{
1536 0: mojom_types.MojomMethod{ 1667 0: mojom_types.MojomMethod{
1537 DeclData: newDeclData(test.fileNameB(), "DoIt", ""), 1668 DeclData: newDeclData(test.fileNameB(), "DoIt", ""),
1538 Parameters: mojom_types.MojomStruct{ 1669 Parameters: mojom_types.MojomStruct{
1539 DeclData: newDeclData(test.fileN ameB(), "DoIt-request", ""), 1670 DeclData: newDeclData(test.fileN ameB(), "DoIt-request", ""),
1540 Fields: []mojom_types.StructFiel d{ 1671 Fields: []mojom_types.StructFiel d{
1541 mojom_types.StructField{ 1672 mojom_types.StructField{
1542 » » » » » » » » DeclData: newDec lData(test.fileNameB(), "x", ""), 1673 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameB(), "x", ""),
1543 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1674 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1544 false, f alse, stringPointer("a.b.c.FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}}, 1675 false, f alse, stringPointer("a.b.c.FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}},
1545 }, 1676 },
1546 }, 1677 },
1547 }, 1678 },
1548 ResponseParams: &mojom_types.MojomStruct { 1679 ResponseParams: &mojom_types.MojomStruct {
1549 DeclData: newDeclData(test.fileN ameB(), "DoIt-response", ""), 1680 DeclData: newDeclData(test.fileN ameB(), "DoIt-response", ""),
1550 Fields: []mojom_types.StructFiel d{ 1681 Fields: []mojom_types.StructFiel d{
1551 mojom_types.StructField{ 1682 mojom_types.StructField{
1552 » » » » » » » » DeclData: newDec lData(test.fileNameB(), "y", ""), 1683 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameB(), "y", ""),
1553 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1684 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1554 true, fa lse, stringPointer("FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}}, 1685 true, fa lse, stringPointer("FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}},
1555 }, 1686 },
1556 }, 1687 },
1557 }, 1688 },
1558 }, 1689 },
1559 }, 1690 },
1560 }} 1691 }}
1561 1692
1562 test.endTestCase() 1693 test.endTestCase()
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 {"ServiceName", &mojom_types.LiteralValu eStringValue{"AwesomeService"}}, 1744 {"ServiceName", &mojom_types.LiteralValu eStringValue{"AwesomeService"}},
1614 {"Height", &mojom_types.LiteralValueDoub leValue{10.1}}}), 1745 {"Height", &mojom_types.LiteralValueDoub leValue{10.1}}}),
1615 ServiceName: stringPointer("AwesomeService"), 1746 ServiceName: stringPointer("AwesomeService"),
1616 Methods: map[uint32]mojom_types.MojomMethod{ 1747 Methods: map[uint32]mojom_types.MojomMethod{
1617 0: mojom_types.MojomMethod{ 1748 0: mojom_types.MojomMethod{
1618 DeclData: newDeclData(test.fileNameA(), "DoIt", ""), 1749 DeclData: newDeclData(test.fileNameA(), "DoIt", ""),
1619 Parameters: mojom_types.MojomStruct{ 1750 Parameters: mojom_types.MojomStruct{
1620 DeclData: newDeclData(test.fileN ameA(), "DoIt-request", ""), 1751 DeclData: newDeclData(test.fileN ameA(), "DoIt-request", ""),
1621 Fields: []mojom_types.StructFiel d{ 1752 Fields: []mojom_types.StructFiel d{
1622 mojom_types.StructField{ 1753 mojom_types.StructField{
1623 » » » » » » » » DeclData: newDec lData(test.fileNameA(), "x", ""), 1754 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameA(), "x", ""),
1624 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1755 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1625 false, f alse, stringPointer("FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}}, 1756 false, f alse, stringPointer("FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}},
1626 }, 1757 },
1627 }, 1758 },
1628 }, 1759 },
1629 ResponseParams: &mojom_types.MojomStruct { 1760 ResponseParams: &mojom_types.MojomStruct {
1630 DeclData: newDeclData(test.fileN ameA(), "DoIt-response", ""), 1761 DeclData: newDeclData(test.fileN ameA(), "DoIt-response", ""),
1631 Fields: []mojom_types.StructFiel d{ 1762 Fields: []mojom_types.StructFiel d{
1632 mojom_types.StructField{ 1763 mojom_types.StructField{
1633 » » » » » » » » DeclData: newDec lData(test.fileNameA(), "y", ""), 1764 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameA(), "y", ""),
1634 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1765 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1635 true, fa lse, stringPointer("b.c.d.FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}}, 1766 true, fa lse, stringPointer("b.c.d.FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}},
1636 }, 1767 },
1637 }, 1768 },
1638 }, 1769 },
1639 }, 1770 },
1640 }, 1771 },
1641 }} 1772 }}
1642 1773
1643 //////////////////////////////////////////////////////////////// //////// 1774 //////////////////////////////////////////////////////////////// ////////
1644 1775
1645 // TypeMap for file B 1776 // TypeMap for file B
1646 1777
1647 // FooA 1778 // FooA
1648 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.FooB"] = &mojom_types.UserDefinedTypeStructType{mojom_types.MojomStruct{ 1779 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.FooB"] = &mojom_types.UserDefinedTypeStructType{mojom_types.MojomStruct{
1649 DeclData: newDeclData(test.fileNameB(), "FooB", "b.c.d.F ooB"), 1780 DeclData: newDeclData(test.fileNameB(), "FooB", "b.c.d.F ooB"),
1650 Fields: []mojom_types.StructField{}}} 1781 Fields: []mojom_types.StructField{}}}
1651 1782
1652 // InterfaceB 1783 // InterfaceB
1653 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.Interfac eB"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{ 1784 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.Interfac eB"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{
1654 DeclData: newDeclDataA(test.fileNameB(), "InterfaceB", " b.c.d.InterfaceB", 1785 DeclData: newDeclDataA(test.fileNameB(), "InterfaceB", " b.c.d.InterfaceB",
1655 &[]mojom_types.Attribute{{"ServiceName", &mojom_ types.LiteralValueInt8Value{42}}}), 1786 &[]mojom_types.Attribute{{"ServiceName", &mojom_ types.LiteralValueInt8Value{42}}}),
1656 Methods: map[uint32]mojom_types.MojomMethod{ 1787 Methods: map[uint32]mojom_types.MojomMethod{
1657 0: mojom_types.MojomMethod{ 1788 0: mojom_types.MojomMethod{
1658 DeclData: newDeclData(test.fileNameB(), "DoIt", ""), 1789 DeclData: newDeclData(test.fileNameB(), "DoIt", ""),
1659 Parameters: mojom_types.MojomStruct{ 1790 Parameters: mojom_types.MojomStruct{
1660 DeclData: newDeclData(test.fileN ameB(), "DoIt-request", ""), 1791 DeclData: newDeclData(test.fileN ameB(), "DoIt-request", ""),
1661 Fields: []mojom_types.StructFiel d{ 1792 Fields: []mojom_types.StructFiel d{
1662 mojom_types.StructField{ 1793 mojom_types.StructField{
1663 » » » » » » » » DeclData: newDec lData(test.fileNameB(), "x", ""), 1794 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameB(), "x", ""),
1664 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1795 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1665 false, f alse, stringPointer("a.b.c.FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}}, 1796 false, f alse, stringPointer("a.b.c.FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}},
1666 }, 1797 },
1667 }, 1798 },
1668 }, 1799 },
1669 ResponseParams: &mojom_types.MojomStruct { 1800 ResponseParams: &mojom_types.MojomStruct {
1670 DeclData: newDeclData(test.fileN ameB(), "DoIt-response", ""), 1801 DeclData: newDeclData(test.fileN ameB(), "DoIt-response", ""),
1671 Fields: []mojom_types.StructFiel d{ 1802 Fields: []mojom_types.StructFiel d{
1672 mojom_types.StructField{ 1803 mojom_types.StructField{
1673 » » » » » » » » DeclData: newDec lData(test.fileNameB(), "y", ""), 1804 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameB(), "y", ""),
1674 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1805 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1675 true, fa lse, stringPointer("FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}}, 1806 true, fa lse, stringPointer("FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}},
1676 }, 1807 },
1677 }, 1808 },
1678 }, 1809 },
1679 }, 1810 },
1680 }, 1811 },
1681 }} 1812 }}
1682 1813
1683 test.endTestCase() 1814 test.endTestCase()
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 DeclData: newDeclDataA(test.fileNameA(), "InterfaceA", " a.b.c.InterfaceA", 1865 DeclData: newDeclDataA(test.fileNameA(), "InterfaceA", " a.b.c.InterfaceA",
1735 &[]mojom_types.Attribute{{"ServiceName", &mojom_ types.LiteralValueStringValue{"AwesomeService"}}}), 1866 &[]mojom_types.Attribute{{"ServiceName", &mojom_ types.LiteralValueStringValue{"AwesomeService"}}}),
1736 ServiceName: stringPointer("AwesomeService"), 1867 ServiceName: stringPointer("AwesomeService"),
1737 Methods: map[uint32]mojom_types.MojomMethod{ 1868 Methods: map[uint32]mojom_types.MojomMethod{
1738 0: mojom_types.MojomMethod{ 1869 0: mojom_types.MojomMethod{
1739 DeclData: newDeclData(test.fileNameA(), "DoIt", ""), 1870 DeclData: newDeclData(test.fileNameA(), "DoIt", ""),
1740 Parameters: mojom_types.MojomStruct{ 1871 Parameters: mojom_types.MojomStruct{
1741 DeclData: newDeclData(test.fileN ameA(), "DoIt-request", ""), 1872 DeclData: newDeclData(test.fileN ameA(), "DoIt-request", ""),
1742 Fields: []mojom_types.StructFiel d{ 1873 Fields: []mojom_types.StructFiel d{
1743 mojom_types.StructField{ 1874 mojom_types.StructField{
1744 » » » » » » » » DeclData: newDec lData(test.fileNameA(), "x", ""), 1875 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameA(), "x", ""),
1745 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1876 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1746 false, f alse, stringPointer("FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}}, 1877 false, f alse, stringPointer("FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}},
1747 }, 1878 },
1748 }, 1879 },
1749 }, 1880 },
1750 ResponseParams: &mojom_types.MojomStruct { 1881 ResponseParams: &mojom_types.MojomStruct {
1751 DeclData: newDeclData(test.fileN ameA(), "DoIt-response", ""), 1882 DeclData: newDeclData(test.fileN ameA(), "DoIt-response", ""),
1752 Fields: []mojom_types.StructFiel d{ 1883 Fields: []mojom_types.StructFiel d{
1753 mojom_types.StructField{ 1884 mojom_types.StructField{
1754 » » » » » » » » DeclData: newDec lData(test.fileNameA(), "y", ""), 1885 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameA(), "y", ""),
1755 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1886 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1756 true, fa lse, stringPointer("b.c.d.FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}}, 1887 true, fa lse, stringPointer("b.c.d.FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}},
1757 }, 1888 },
1758 }, 1889 },
1759 }, 1890 },
1760 }, 1891 },
1761 }, 1892 },
1762 }} 1893 }}
1763 1894
1764 //////////////////////////////////////////////////////////////// //////// 1895 //////////////////////////////////////////////////////////////// ////////
(...skipping 10 matching lines...) Expand all
1775 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.Enum2"] = &mojom_types.UserDefinedTypeEnumType{mojom_types.MojomEnum{ 1906 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.Enum2"] = &mojom_types.UserDefinedTypeEnumType{mojom_types.MojomEnum{
1776 DeclData: newDeclData(test.fileNameB(), "Enum2", "b.c.d. Enum2"), 1907 DeclData: newDeclData(test.fileNameB(), "Enum2", "b.c.d. Enum2"),
1777 Values: []mojom_types.EnumValue{}, 1908 Values: []mojom_types.EnumValue{},
1778 }} 1909 }}
1779 1910
1780 // FooA 1911 // FooA
1781 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.FooB"] = &mojom_types.UserDefinedTypeStructType{mojom_types.MojomStruct{ 1912 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.FooB"] = &mojom_types.UserDefinedTypeStructType{mojom_types.MojomStruct{
1782 DeclData: newDeclData(test.fileNameB(), "FooB", "b.c.d.F ooB"), 1913 DeclData: newDeclData(test.fileNameB(), "FooB", "b.c.d.F ooB"),
1783 Fields: []mojom_types.StructField{ 1914 Fields: []mojom_types.StructField{
1784 mojom_types.StructField{ 1915 mojom_types.StructField{
1785 » » » » » DeclData: newDeclData(test.fileNameB(), "x", ""), 1916 » » » » » DeclData: newDeclDataO(0, -1, test.fileN ameB(), "x", ""),
1786 Type: &mojom_types.TypeTypeReference{moj om_types.TypeReference{ 1917 Type: &mojom_types.TypeTypeReference{moj om_types.TypeReference{
1787 false, false, stringPointer("Enu m1"), stringPointer("TYPE_KEY:b.c.d.Enum1")}}, 1918 false, false, stringPointer("Enu m1"), stringPointer("TYPE_KEY:b.c.d.Enum1")}},
1788 }, 1919 },
1789 }, 1920 },
1790 }} 1921 }}
1791 1922
1792 // InterfaceB 1923 // InterfaceB
1793 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.Interfac eB"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{ 1924 test.expectedRuntimeTypeInfoB().TypeMap["TYPE_KEY:b.c.d.Interfac eB"] = &mojom_types.UserDefinedTypeInterfaceType{mojom_types.MojomInterface{
1794 DeclData: newDeclData(test.fileNameB(), "InterfaceB", "b .c.d.InterfaceB"), 1925 DeclData: newDeclData(test.fileNameB(), "InterfaceB", "b .c.d.InterfaceB"),
1795 Methods: map[uint32]mojom_types.MojomMethod{ 1926 Methods: map[uint32]mojom_types.MojomMethod{
1796 0: mojom_types.MojomMethod{ 1927 0: mojom_types.MojomMethod{
1797 DeclData: newDeclData(test.fileNameB(), "DoIt", ""), 1928 DeclData: newDeclData(test.fileNameB(), "DoIt", ""),
1798 Parameters: mojom_types.MojomStruct{ 1929 Parameters: mojom_types.MojomStruct{
1799 DeclData: newDeclData(test.fileN ameB(), "DoIt-request", ""), 1930 DeclData: newDeclData(test.fileN ameB(), "DoIt-request", ""),
1800 Fields: []mojom_types.StructFiel d{ 1931 Fields: []mojom_types.StructFiel d{
1801 mojom_types.StructField{ 1932 mojom_types.StructField{
1802 » » » » » » » » DeclData: newDec lData(test.fileNameB(), "x", ""), 1933 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameB(), "x", ""),
1803 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1934 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1804 false, f alse, stringPointer("a.b.c.FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}}, 1935 false, f alse, stringPointer("a.b.c.FooA"), stringPointer("TYPE_KEY:a.b.c.FooA")}},
1805 }, 1936 },
1806 }, 1937 },
1807 }, 1938 },
1808 ResponseParams: &mojom_types.MojomStruct { 1939 ResponseParams: &mojom_types.MojomStruct {
1809 DeclData: newDeclData(test.fileN ameB(), "DoIt-response", ""), 1940 DeclData: newDeclData(test.fileN ameB(), "DoIt-response", ""),
1810 Fields: []mojom_types.StructFiel d{ 1941 Fields: []mojom_types.StructFiel d{
1811 mojom_types.StructField{ 1942 mojom_types.StructField{
1812 » » » » » » » » DeclData: newDec lData(test.fileNameB(), "y", ""), 1943 » » » » » » » » DeclData: newDec lDataO(0, -1, test.fileNameB(), "y", ""),
1813 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1944 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1814 true, fa lse, stringPointer("FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}}, 1945 true, fa lse, stringPointer("FooB"), stringPointer("TYPE_KEY:b.c.d.FooB")}},
1815 }, 1946 },
1816 mojom_types.StructField{ 1947 mojom_types.StructField{
1817 » » » » » » » » DeclData: newDec lData(test.fileNameB(), "z", ""), 1948 » » » » » » » » DeclData: newDec lDataO(1, -1, test.fileNameB(), "z", ""),
1818 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{ 1949 Type: &mojom_typ es.TypeTypeReference{mojom_types.TypeReference{
1819 false, f alse, stringPointer("Enum2"), stringPointer("TYPE_KEY:b.c.d.Enum2")}}, 1950 false, f alse, stringPointer("Enum2"), stringPointer("TYPE_KEY:b.c.d.Enum2")}},
1820 }, 1951 },
1821 }, 1952 },
1822 }, 1953 },
1823 }, 1954 },
1824 }, 1955 },
1825 }} 1956 }}
1826 1957
1827 test.endTestCase() 1958 test.endTestCase()
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 } 2058 }
1928 return fmt.Errorf("*****\nexpected=\n*****\n%q\n*****\na ctual=\n*****\n%q\n*****\n"+ 2059 return fmt.Errorf("*****\nexpected=\n*****\n%q\n*****\na ctual=\n*****\n%q\n*****\n"+
1929 "match failed at position %d: expected=\n*****\n %q\n******\nactual=\n*****\n%q\n******\n", 2060 "match failed at position %d: expected=\n*****\n %q\n******\nactual=\n*****\n%q\n******\n",
1930 expectedString, actualString, diffPos, mismatchE xpected, mismatchActual) 2061 expectedString, actualString, diffPos, mismatchE xpected, mismatchActual)
1931 } else { 2062 } else {
1932 return fmt.Errorf("expected != actual but the two printe d equal.") 2063 return fmt.Errorf("expected != actual but the two printe d equal.")
1933 } 2064 }
1934 } 2065 }
1935 return nil 2066 return nil
1936 } 2067 }
OLDNEW
« 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