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

Side by Side Diff: mojo/dart/unittests/embedder_tests/bindings_generation_test.dart

Issue 1958463003: Mojom compiler: Eliminate duplicate representation of enum values in mojom_files.mojom. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Responded to code reveiw comments. Created 4 years, 7 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « mojo/dart/packages/mojo/lib/mojo/bindings/types/mojom_types.mojom.dart ('k') | mojo/go/tests/validation_type_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698