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

Unified Diff: lib/src/runner/browser/compiler_pool.dart

Issue 983573002: Add support for running browser tests to the test runner. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 10 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: lib/src/runner/browser/compiler_pool.dart
diff --git a/lib/src/runner/browser/compiler_pool.dart b/lib/src/runner/browser/compiler_pool.dart
index cf77fe06ed553ba04f020fe2b8a707dc9caf2a4f..7e8ede706ddd4409fc5bfa1d8421eb35caaeb0e7 100644
--- a/lib/src/runner/browser/compiler_pool.dart
+++ b/lib/src/runner/browser/compiler_pool.dart
@@ -24,6 +24,9 @@ class CompilerPool {
/// The internal pool that controls the number of process running at once.
final Pool _pool;
+ /// Whether to enable colors on dart2js.
+ final bool _color;
+
/// The currently-active compilers.
///
/// The first one is the only visible the compiler; the rest will become
@@ -36,8 +39,11 @@ class CompilerPool {
/// at once.
///
/// If [parallel] isn't provided, it defaults to 4.
- CompilerPool({int parallel})
- : _pool = new Pool(parallel == null ? 4 : parallel);
+ ///
+ /// If [color] is true, `dart2js` will be run with colors enabled.
+ CompilerPool({int parallel, bool color: false})
+ : _pool = new Pool(parallel == null ? 4 : parallel),
+ _color = color;
/// Compile the Dart code at [dartPath] to [jsPath].
///
@@ -70,9 +76,7 @@ void main(_) {
args.add("--package-root=${p.absolute(packageRoot)}");
}
- if (canUseSpecialChars) {
- args.add("--enable-diagnostic-colors");
- }
+ if (_color) args.add("--enable-diagnostic-colors");
return Process.start(dart2jsPath, args).then((process) {
var compiler = new _Compiler(dartPath, process);

Powered by Google App Engine
This is Rietveld 408576698