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

Side by Side Diff: tests/compiler/dart2js/resolution_test.dart

Issue 2935663002: Remove Compiler.commonElements (Closed)
Patch Set: Remove Compiler._commonElements Created 3 years, 6 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 | « tests/compiler/dart2js/related_types.dart ('k') | tests/compiler/dart2js/resolver_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 resolution does not resolve things we know will not be 5 // Test that resolution does not resolve things we know will not be
6 // needed by the backend. 6 // needed by the backend.
7 7
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import 'package:compiler/src/apiimpl.dart'; 10 import 'package:compiler/src/apiimpl.dart';
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void test(String code, void check(CompilerImpl compiler)) { 95 void test(String code, void check(CompilerImpl compiler)) {
96 Uri uri = new Uri(scheme: 'source'); 96 Uri uri = new Uri(scheme: 'source');
97 var compiler = compilerFor(code, uri); 97 var compiler = compilerFor(code, uri);
98 asyncTest(() => compiler.run(uri).then((_) { 98 asyncTest(() => compiler.run(uri).then((_) {
99 check(compiler); 99 check(compiler);
100 })); 100 }));
101 } 101 }
102 102
103 void testHasRuntimeType(String code) { 103 void testHasRuntimeType(String code) {
104 test(code, (compiler) { 104 test(code, (compiler) {
105 var element = compiler.commonElements.createRuntimeType; 105 var element = compiler.resolution.commonElements.createRuntimeType;
106 Expect.isTrue( 106 Expect.isTrue(
107 compiler.enqueuer.resolution.processedEntities.contains(element)); 107 compiler.enqueuer.resolution.processedEntities.contains(element));
108 }); 108 });
109 } 109 }
110 110
111 main() { 111 main() {
112 test(NO_RUNTIME_TYPE, (compiler) { 112 test(NO_RUNTIME_TYPE, (compiler) {
113 var element = compiler.commonElements.createRuntimeType; 113 var element = compiler.resolution.commonElements.createRuntimeType;
114 Expect.isFalse( 114 Expect.isFalse(
115 compiler.enqueuer.resolution.processedEntities.contains(element)); 115 compiler.enqueuer.resolution.processedEntities.contains(element));
116 }); 116 });
117 117
118 testHasRuntimeType(HAS_RUNTIME_TYPE_1); 118 testHasRuntimeType(HAS_RUNTIME_TYPE_1);
119 testHasRuntimeType(HAS_RUNTIME_TYPE_2); 119 testHasRuntimeType(HAS_RUNTIME_TYPE_2);
120 testHasRuntimeType(HAS_RUNTIME_TYPE_3); 120 testHasRuntimeType(HAS_RUNTIME_TYPE_3);
121 testHasRuntimeType(HAS_RUNTIME_TYPE_4); 121 testHasRuntimeType(HAS_RUNTIME_TYPE_4);
122 testHasRuntimeType(HAS_RUNTIME_TYPE_5); 122 testHasRuntimeType(HAS_RUNTIME_TYPE_5);
123 testHasRuntimeType(HAS_RUNTIME_TYPE_6); 123 testHasRuntimeType(HAS_RUNTIME_TYPE_6);
124 } 124 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/related_types.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698