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

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

Issue 2846433003: Run closed_world2_test using the normal compiler pipeline. (Closed)
Patch Set: Updated cf. comments Created 3 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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import "dart:async"; 5 import "dart:async";
6 6
7 import "package:async_helper/async_helper.dart"; 7 import "package:async_helper/async_helper.dart";
8 import 'package:compiler/compiler.dart'; 8 import 'package:compiler/compiler.dart';
9 import "package:compiler/src/elements/elements.dart"; 9 import "package:compiler/src/elements/elements.dart";
10 import "package:compiler/src/old_to_new_api.dart"; 10 import "package:compiler/src/old_to_new_api.dart";
11 import "package:expect/expect.dart"; 11 import "package:expect/expect.dart";
12 12
13 import "mock_compiler.dart"; 13 import "mock_compiler.dart";
14 14
15 Future testErrorHandling() { 15 Future testErrorHandling() {
16 // Test that compiler.currentElement is set correctly when 16 // Test that compiler.currentElement is set correctly when
17 // reporting errors/warnings. 17 // reporting errors/warnings.
18 MockCompiler compiler = new MockCompiler.internal(); 18 MockCompiler compiler = new MockCompiler.internal();
19 return compiler.init().then((_) { 19 return compiler.init().then((_) {
20 compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}'); 20 compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}');
21 FunctionElement foo = compiler.mainApp.find('foo'); 21 LibraryElement mainApp = compiler.mainApp;
22 FunctionElement foo = mainApp.find('foo');
22 compiler.diagnosticHandler = new LegacyCompilerDiagnostics( 23 compiler.diagnosticHandler = new LegacyCompilerDiagnostics(
23 (Uri uri, int begin, int end, String message, Diagnostic kind) { 24 (Uri uri, int begin, int end, String message, Diagnostic kind) {
24 if (kind == Diagnostic.WARNING) { 25 if (kind == Diagnostic.WARNING) {
25 Expect.equals(foo, compiler.currentElement); 26 Expect.equals(foo, compiler.currentElement);
26 } 27 }
27 }); 28 });
28 foo.computeType(compiler.resolution); 29 foo.computeType(compiler.resolution);
29 Expect.equals(1, compiler.diagnosticCollector.warnings.length); 30 Expect.equals(1, compiler.diagnosticCollector.warnings.length);
30 }); 31 });
31 } 32 }
32 33
33 main() { 34 main() {
34 asyncTest(() => testErrorHandling()); 35 asyncTest(() => testErrorHandling());
35 } 36 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/compiler_helper.dart ('k') | tests/compiler/dart2js/deferred_dont_inline_deferred_constants_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698