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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 Expect.equals(me.declData.fullIdentifier, fullIdentifier); | 446 Expect.equals(me.declData.fullIdentifier, fullIdentifier); |
447 | 447 |
448 // Now compare the labels to verify that the enum labels match the expected | 448 // Now compare the labels to verify that the enum labels match the expected |
449 // ones. | 449 // ones. |
450 Expect.equals(me.values.length, labelMap.length); | 450 Expect.equals(me.values.length, labelMap.length); |
451 me.values.forEach((mojom_types.EnumValue ev) { | 451 me.values.forEach((mojom_types.EnumValue ev) { |
452 // Check that the declData is correct... | 452 // Check that the declData is correct... |
453 Expect.isNotNull(ev.declData); | 453 Expect.isNotNull(ev.declData); |
454 Expect.isNotNull(labelMap[ev.declData.shortName]); | 454 Expect.isNotNull(labelMap[ev.declData.shortName]); |
455 | 455 |
456 // Check that the enumTypeKey matches the enumID. | 456 // Check that the enum value's intValue is as expected. |
457 Expect.equals(ev.enumTypeKey, enumID); | |
458 Expect.equals(ev.intValue, labelMap[ev.declData.shortName]); | 457 Expect.equals(ev.intValue, labelMap[ev.declData.shortName]); |
459 }); | 458 }); |
460 } | 459 } |
461 | 460 |
462 // Test that mojom type descriptors were generated correctly for validation's | 461 // Test that mojom type descriptors were generated correctly for validation's |
463 // StructE. | 462 // StructE. |
464 testValidateStructType() { | 463 testValidateStructType() { |
465 var testValidationDescriptor = validation.getAllMojomTypeDefinitions(); | 464 var testValidationDescriptor = validation.getAllMojomTypeDefinitions(); |
466 String shortName = "StructE"; | 465 String shortName = "StructE"; |
467 String fullIdentifier = "mojo.test.StructE"; | 466 String fullIdentifier = "mojo.test.StructE"; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 testValidateMojomTypes(); | 755 testValidateMojomTypes(); |
757 testCamelCase(); | 756 testCamelCase(); |
758 testSerializeErrorMessage(); | 757 testSerializeErrorMessage(); |
759 await testEnums(); | 758 await testEnums(); |
760 await testCallResponse(); | 759 await testCallResponse(); |
761 await testAwaitCallResponse(); | 760 await testAwaitCallResponse(); |
762 await runOnClosedTest(); | 761 await runOnClosedTest(); |
763 await testRegression551(); | 762 await testRegression551(); |
764 await testServiceName(); | 763 await testServiceName(); |
765 } | 764 } |
OLD | NEW |