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

Unified Diff: lib/src/runner/browser/server.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/server.dart
diff --git a/lib/src/runner/browser/server.dart b/lib/src/runner/browser/server.dart
index 5fdae5ed35b733b50e77b14942e7dcdab5f6d1ac..74c7b49eb85af4bfc94adb22c2e2d5bf78187db5 100644
--- a/lib/src/runner/browser/server.dart
+++ b/lib/src/runner/browser/server.dart
@@ -30,8 +30,10 @@ class BrowserServer {
/// If [packageRoot] is passed, it's used for all package imports when
/// compiling tests to JS. Otherwise, the package root is inferred from the
/// location of the source file.
- static Future<BrowserServer> start({String packageRoot}) {
- var server = new BrowserServer._(packageRoot);
+ ///
+ /// If [color] is true, console colors will be used when compiling Dart.
+ static Future<BrowserServer> start({String packageRoot, bool color: false}) {
+ var server = new BrowserServer._(packageRoot, color);
return server._load().then((_) => server);
}
@@ -49,7 +51,7 @@ class BrowserServer {
final _webSocketHandler = new OneOffHandler();
/// The [CompilerPool] managing active instances of `dart2js`.
- final _compilers = new CompilerPool();
+ final CompilerPool _compilers;
/// The temporary directory in which compiled JS is emitted.
final String _compiledDir;
@@ -89,8 +91,9 @@ class BrowserServer {
}
Completer<BrowserManager> _browserManagerCompleter;
- BrowserServer._(this._packageRoot)
- : _compiledDir = Directory.systemTemp.createTempSync('unittest_').path;
+ BrowserServer._(this._packageRoot, bool color)
+ : _compiledDir = Directory.systemTemp.createTempSync('unittest_').path,
+ _compilers = new CompilerPool(color: color);
/// Starts the underlying server.
Future _load() {

Powered by Google App Engine
This is Rietveld 408576698