| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:isolate'; | 6 import 'dart:isolate'; |
| 7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:mojo/bindings.dart' as bindings; | 10 import 'package:mojo/bindings.dart' as bindings; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 Expect.equals(32, s2.objectUnion.fPodUnion.fUint32); | 239 Expect.equals(32, s2.objectUnion.fPodUnion.fUint32); |
| 240 } | 240 } |
| 241 | 241 |
| 242 testUnionsToString() { | 242 testUnionsToString() { |
| 243 var podUnion = new unions.PodUnion(); | 243 var podUnion = new unions.PodUnion(); |
| 244 podUnion.fUint32 = 32; | 244 podUnion.fUint32 = 32; |
| 245 Expect.equals("PodUnion(fUint32: 32)", podUnion.toString()); | 245 Expect.equals("PodUnion(fUint32: 32)", podUnion.toString()); |
| 246 } | 246 } |
| 247 | 247 |
| 248 testSerializeEnumArray() { |
| 249 var s = new regression.ContainsNullableArrayOfEnum(); |
| 250 s.arrayOfEnums = [ |
| 251 regression.NormalEnum.first, |
| 252 regression.NormalEnum.second, |
| 253 regression.NormalEnum.second, |
| 254 regression.NormalEnum.first, |
| 255 ]; |
| 256 |
| 257 var message = messageOfStruct(s); |
| 258 var s2 = regression.ContainsNullableArrayOfEnum.deserialize(message.payload); |
| 259 for (int i = 0; i < s.arrayOfEnums.length; i++) { |
| 260 Expect.equals(s.arrayOfEnums[i], s2.arrayOfEnums[i]); |
| 261 } |
| 262 } |
| 263 |
| 248 testUnions() { | 264 testUnions() { |
| 249 testSerializePodUnions(); | 265 testSerializePodUnions(); |
| 250 testSerializeStructInUnion(); | 266 testSerializeStructInUnion(); |
| 251 testSerializeArrayInUnion(); | 267 testSerializeArrayInUnion(); |
| 252 testSerializeMapInUnion(); | 268 testSerializeMapInUnion(); |
| 253 testSerializeUnionInArray(); | 269 testSerializeUnionInArray(); |
| 254 testSerializeUnionInMap(); | 270 testSerializeUnionInMap(); |
| 255 testSerializeUnionInUnion(); | 271 testSerializeUnionInUnion(); |
| 256 testUnionsToString(); | 272 testUnionsToString(); |
| 273 testSerializeEnumArray(); |
| 257 } | 274 } |
| 258 | 275 |
| 259 class CheckEnumCapsImpl implements regression.CheckEnumCaps { | 276 class CheckEnumCapsImpl implements regression.CheckEnumCaps { |
| 260 regression.CheckEnumCapsStub _stub; | 277 regression.CheckEnumCapsStub _stub; |
| 261 | 278 |
| 262 CheckEnumCapsImpl(core.MojoMessagePipeEndpoint endpoint) { | 279 CheckEnumCapsImpl(core.MojoMessagePipeEndpoint endpoint) { |
| 263 _stub = new regression.CheckEnumCapsStub.fromEndpoint(endpoint, this); | 280 _stub = new regression.CheckEnumCapsStub.fromEndpoint(endpoint, this); |
| 264 } | 281 } |
| 265 | 282 |
| 266 setEnumWithInternalAllCaps(regression.EnumWithInternalAllCaps e) {} | 283 setEnumWithInternalAllCaps(regression.EnumWithInternalAllCaps e) {} |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 testUnions(); | 766 testUnions(); |
| 750 testValidateMojomTypes(); | 767 testValidateMojomTypes(); |
| 751 testCamelCase(); | 768 testCamelCase(); |
| 752 testSerializeErrorMessage(); | 769 testSerializeErrorMessage(); |
| 753 await testEnums(); | 770 await testEnums(); |
| 754 await testAwaitCallResponse(); | 771 await testAwaitCallResponse(); |
| 755 await runOnClosedTest(); | 772 await runOnClosedTest(); |
| 756 await testRegression551(); | 773 await testRegression551(); |
| 757 await testServiceName(); | 774 await testServiceName(); |
| 758 } | 775 } |
| OLD | NEW |