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

Unified Diff: tests/compiler/dart2js/compiler_test.dart

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/compiler_test.dart
diff --git a/tests/compiler/dart2js/compiler_test.dart b/tests/compiler/dart2js/compiler_test.dart
index deb480b426dcdf8675ab046d60b334edd6e08f95..74f9b17e718f235106524b1939e7aa241228c82f 100644
--- a/tests/compiler/dart2js/compiler_test.dart
+++ b/tests/compiler/dart2js/compiler_test.dart
@@ -5,15 +5,26 @@
import "dart:async";
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
-import "package:compiler/src/diagnostics/messages.dart";
import "package:compiler/src/elements/elements.dart";
import "package:compiler/src/resolution/members.dart";
import "package:compiler/src/diagnostics/diagnostic_listener.dart";
import "mock_compiler.dart";
+import "diagnostic_reporter_helper.dart";
class CallbackMockCompiler extends MockCompiler {
- CallbackMockCompiler() : super.internal();
+ CallbackReporter reporter;
+
+ CallbackMockCompiler() : super.internal() {
+ reporter = new CallbackReporter(super.reporter);
+ }
+
+}
+
+class CallbackReporter extends DiagnosticReporterWrapper {
+ final DiagnosticReporter reporter;
+
+ CallbackReporter(this.reporter);
var onError;
var onWarning;
@@ -48,7 +59,7 @@ Future testErrorHandling() {
ResolverVisitor visitor = compiler.resolverVisitor();
compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}');
FunctionElement foo = compiler.mainApp.find('foo');
- compiler.setOnWarning(
+ compiler.reporter.setOnWarning(
(c, n, m) => Expect.equals(foo, compiler.currentElement));
foo.computeType(compiler.resolution);
Expect.equals(1, compiler.warnings.length);
« no previous file with comments | « tests/compiler/dart2js/backend_dart/dart_printer_test.dart ('k') | tests/compiler/dart2js/diagnostic_reporter_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698