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

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

Issue 1415463022: Use DiagnosticMessage in MockCompiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 import "package:async_helper/async_helper.dart"; 7 import "package:async_helper/async_helper.dart";
8 import "package:compiler/src/elements/elements.dart"; 8 import "package:compiler/src/elements/elements.dart";
9 import "package:compiler/src/resolution/members.dart"; 9 import "package:compiler/src/resolution/members.dart";
10 import "package:compiler/src/diagnostics/diagnostic_listener.dart"; 10 import "package:compiler/src/diagnostics/diagnostic_listener.dart";
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // Test that compiler.currentElement is set correctly when 55 // Test that compiler.currentElement is set correctly when
56 // reporting errors/warnings. 56 // reporting errors/warnings.
57 CallbackMockCompiler compiler = new CallbackMockCompiler(); 57 CallbackMockCompiler compiler = new CallbackMockCompiler();
58 return compiler.init().then((_) { 58 return compiler.init().then((_) {
59 ResolverVisitor visitor = compiler.resolverVisitor(); 59 ResolverVisitor visitor = compiler.resolverVisitor();
60 compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}'); 60 compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}');
61 FunctionElement foo = compiler.mainApp.find('foo'); 61 FunctionElement foo = compiler.mainApp.find('foo');
62 compiler.reporter.setOnWarning( 62 compiler.reporter.setOnWarning(
63 (c, n, m) => Expect.equals(foo, compiler.currentElement)); 63 (c, n, m) => Expect.equals(foo, compiler.currentElement));
64 foo.computeType(compiler.resolution); 64 foo.computeType(compiler.resolution);
65 Expect.equals(1, compiler.warnings.length); 65 Expect.equals(1, compiler.diagnosticCollector.warnings.length);
66 }); 66 });
67 } 67 }
68 68
69 main() { 69 main() {
70 asyncTest(() => testErrorHandling()); 70 asyncTest(() => testErrorHandling());
71 } 71 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698