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

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

Issue 1097183003: Add an "onPlatform" parameter to test() and group(). (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 years, 8 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 | « lib/src/backend/test.dart ('k') | lib/src/runner/browser/iframe_listener.dart » ('j') | no next file with comments »
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 380be41f42be4b6db91ac492eb1c1e9cb2ab44da..b20da07929044e06b7455a434c05cc5e05378c18 100644
--- a/lib/src/runner/browser/browser_manager.dart
+++ b/lib/src/runner/browser/browser_manager.dart
@@ -11,6 +11,7 @@ import 'package:http_parser/http_parser.dart';
import '../../backend/metadata.dart';
import '../../backend/suite.dart';
+import '../../backend/test_platform.dart';
import '../../util/multi_channel.dart';
import '../../util/remote_exception.dart';
import '../../utils.dart';
@@ -22,14 +23,17 @@ import 'iframe_test.dart';
/// This is in charge of telling the browser which test suites to load and
/// converting its responses into [Suite] objects.
class BrowserManager {
+ /// The browser that this is managing.
+ final TestPlatform browser;
+
/// The channel used to communicate with the browser.
///
/// This is connected to a page running `static/host.dart`.
final MultiChannel _channel;
- /// Creates a new BrowserManager that communicates with a browser over
+ /// Creates a new BrowserManager that communicates with [browser] over
/// [webSocket].
- BrowserManager(CompatibleWebSocket webSocket)
+ BrowserManager(this.browser, CompatibleWebSocket webSocket)
: _channel = new MultiChannel(
webSocket.map(JSON.decode),
mapSink(webSocket, JSON.encode));
@@ -40,8 +44,10 @@ class BrowserManager {
/// suite. [path] is the path of the original test suite file, which is used
/// for reporting. [metadata] is the parsed metadata for the test suite.
Future<Suite> loadSuite(String path, Uri url, Metadata metadata) {
- url = url.replace(
- fragment: Uri.encodeFull(JSON.encode(metadata.serialize())));
+ url = url.replace(fragment: Uri.encodeFull(JSON.encode({
+ "metadata": metadata.serialize(),
+ "browser": browser.identifier
+ })));
var suiteChannel = _channel.virtualChannel();
_channel.sink.add({
@@ -59,7 +65,9 @@ class BrowserManager {
return maybeFirst(suiteChannel.stream)
.timeout(new Duration(seconds: 7), onTimeout: () {
throw new LoadException(
- path, "Timed out waiting for the test suite to connect.");
+ path,
+ "Timed out waiting for the test suite to connect on "
+ "${browser.name}.");
}).then((response) {
if (response == null) return null;
« no previous file with comments | « lib/src/backend/test.dart ('k') | lib/src/runner/browser/iframe_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698