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

Side by Side Diff: tests/compiler/dart2js/kernel/class_hierarchy_test.dart

Issue 2609433002: Fix rasta unittests: now unit tests need to run the full compiler to use its (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | tests/compiler/dart2js/kernel/visitor_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Test that the dart2js copy of [KernelVisitor] generates the expected class 5 /// Test that the dart2js copy of [KernelVisitor] generates the expected class
6 /// hierarchy. 6 /// hierarchy.
7 7
8 import 'package:compiler/src/compiler.dart' show Compiler; 8 import 'package:compiler/src/compiler.dart' show Compiler;
9 import 'package:compiler/src/elements/elements.dart'; 9 import 'package:compiler/src/elements/elements.dart';
10 import 'package:compiler/src/js_backend/backend.dart' show JavaScriptBackend; 10 import 'package:compiler/src/js_backend/backend.dart' show JavaScriptBackend;
(...skipping 13 matching lines...) Expand all
24 class M { 24 class M {
25 mMethod() {} 25 mMethod() {}
26 } 26 }
27 class C extends S with M { 27 class C extends S with M {
28 cMethod() {} 28 cMethod() {}
29 } 29 }
30 main() {} 30 main() {}
31 ''' 31 '''
32 }, options: [ 32 }, options: [
33 Flags.analyzeOnly, 33 Flags.analyzeOnly,
34 Flags.analyzeMain, 34 Flags.analyzeAll,
35 Flags.useKernel 35 Flags.useKernel
36 ]); 36 ]);
37 test('mixin', () async { 37 test('mixin', () async {
38 Uri mainUri = Uri.parse('memory:main.dart'); 38 Uri mainUri = Uri.parse('memory:main.dart');
39 LibraryElement library = await compiler.analyzeUri(mainUri); 39 await compiler.run(mainUri);
40 LibraryElement library = await compiler.libraryLoader.loadLibrary(mainUri);
40 JavaScriptBackend backend = compiler.backend; 41 JavaScriptBackend backend = compiler.backend;
41 ir.Program program = backend.kernelTask.buildProgram(library); 42 ir.Program program = backend.kernelTask.buildProgram(library);
42 ClassHierarchy hierarchy = new ClassHierarchy(program); 43 ClassHierarchy hierarchy = new ClassHierarchy(program);
43 44
44 ir.Class getClass(String name) { 45 ir.Class getClass(String name) {
45 for (ir.Class cls in hierarchy.classes) { 46 for (ir.Class cls in hierarchy.classes) {
46 if (cls.enclosingLibrary.importUri == mainUri && cls.name == name) { 47 if (cls.enclosingLibrary.importUri == mainUri && cls.name == name) {
47 if (arguments.contains('-v')) { 48 if (arguments.contains('-v')) {
48 print('$cls'); 49 print('$cls');
49 print(' dispatch targets:'); 50 print(' dispatch targets:');
(...skipping 17 matching lines...) Expand all
67 hierarchy.getDispatchTarget(subClass, member.name), equals(member), 68 hierarchy.getDispatchTarget(subClass, member.name), equals(member),
68 reason: 'Unexpected dispatch target for ${member.name} ' 69 reason: 'Unexpected dispatch target for ${member.name} '
69 'in $subClass'); 70 'in $subClass');
70 } 71 }
71 } 72 }
72 73
73 checkInheritance(classS, classC); 74 checkInheritance(classS, classC);
74 checkInheritance(classM, classC); 75 checkInheritance(classM, classC);
75 }); 76 });
76 } 77 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/kernel/visitor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698