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

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

Issue 1263503008: Add an Environment class that's exposed through RunnerSuite. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | lib/src/runner/browser/iframe_listener.dart » ('j') | lib/src/runner/loader.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/browser/browser_manager.dart
diff --git a/lib/src/runner/browser/browser_manager.dart b/lib/src/runner/browser/browser_manager.dart
index bbba2148b7eabded8a5debc74e1f918bc8c3fc85..46a48717556fd6304e223aaea6a88892fda6c9ff 100644
--- a/lib/src/runner/browser/browser_manager.dart
+++ b/lib/src/runner/browser/browser_manager.dart
@@ -16,6 +16,7 @@ import '../../util/multi_channel.dart';
import '../../util/remote_exception.dart';
import '../../util/stack_trace_mapper.dart';
import '../../utils.dart';
+import '../environment.dart';
import '../load_exception.dart';
import '../runner_suite.dart';
import 'iframe_test.dart';
@@ -51,12 +52,16 @@ class BrowserManager {
/// Whether the channel to the browser has closed.
bool _closed = false;
+ /// The environment to attach to each suite.
+ _BrowserEnvironment _environment;
+
/// Creates a new BrowserManager that communicates with [browser] over
/// [webSocket].
BrowserManager(this.browser, CompatibleWebSocket webSocket)
: _channel = new MultiChannel(
webSocket.map(JSON.decode),
mapSink(webSocket, JSON.encode)) {
+ _environment = new _BrowserEnvironment(this);
_channel.stream.listen(null, onDone: () => _closed = true);
}
@@ -140,7 +145,7 @@ class BrowserManager {
asyncError.stackTrace);
}
- return new RunnerSuite(response["tests"].map((test) {
+ return new RunnerSuite(_environment, response["tests"].map((test) {
var testMetadata = new Metadata.deserialize(test['metadata']);
var testChannel = suiteChannel.virtualChannel(test['channel']);
return new IframeTest(test['name'], testMetadata, testChannel,
@@ -149,3 +154,12 @@ class BrowserManager {
onClose: () => closeIframe());
}
}
+
+/// An implementation of [Environment] for the browser.
+///
+/// All methods forward directly to [BrowserManager].
+class _BrowserEnvironment implements Environment {
+ final BrowserManager _manager;
kevmoo 2015/07/30 01:37:24 This field ends up being unused. Uh...
nweiz 2015/07/30 19:41:50 Right, the whole point of this CL is to set the st
+
+ _BrowserEnvironment(this._manager);
+}
« no previous file with comments | « no previous file | lib/src/runner/browser/iframe_listener.dart » ('j') | lib/src/runner/loader.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698