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

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

Issue 1336843003: Avoid dart:io dependency in try (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/mock_compiler.dart
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index 4ae9430a65d46c43a356bc6ca87533b377cafb7c..184463c4be43d9d0275d5261ea3a16206df89a98 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -437,3 +437,31 @@ class MockElement extends FunctionElementX {
bool get hasNode => false;
}
+
+// TODO(herhut): Disallow warnings and errors during compilation by default.
+MockCompiler compilerFor(String code, Uri uri,
+ {bool analyzeAll: false,
+ bool analyzeOnly: false,
+ Map<String, String> coreSource,
+ bool disableInlining: true,
+ bool minify: false,
+ bool trustTypeAnnotations: false,
+ bool enableTypeAssertions: false,
+ int expectedErrors,
+ int expectedWarnings,
+ api.CompilerOutputProvider outputProvider}) {
+ MockCompiler compiler = new MockCompiler.internal(
+ analyzeAll: analyzeAll,
+ analyzeOnly: analyzeOnly,
+ coreSource: coreSource,
+ disableInlining: disableInlining,
+ enableMinification: minify,
+ trustTypeAnnotations: trustTypeAnnotations,
+ enableTypeAssertions: enableTypeAssertions,
+ expectedErrors: expectedErrors,
+ expectedWarnings: expectedWarnings,
+ outputProvider: outputProvider);
+ compiler.registerSource(uri, code);
+ compiler.diagnosticHandler = createHandler(compiler, code);
+ return compiler;
+}

Powered by Google App Engine
This is Rietveld 408576698