Chromium Code Reviews

Unified Diff: lib/src/runner/plugin/remote_platform_helpers.dart

Issue 1685363002: Add a platform plugin infrastructure. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « lib/src/runner/plugin/platform.dart ('k') | lib/src/runner/remote_listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/plugin/remote_platform_helpers.dart
diff --git a/lib/src/runner/plugin/remote_platform_helpers.dart b/lib/src/runner/plugin/remote_platform_helpers.dart
new file mode 100644
index 0000000000000000000000000000000000000000..99206365b7588b0a0e08c7bd691996ecc30a9206
--- /dev/null
+++ b/lib/src/runner/plugin/remote_platform_helpers.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:stream_channel/stream_channel.dart';
+
+import '../../utils.dart';
+import '../remote_listener.dart';
+
+/// Returns a channel that will emit a serialized representation of the tests
+/// defined in [getMain].
+///
+/// This channel is used to control the tests. Platform plugins should forward
+/// it to the return value of [PlatformPlugin.loadChannel]. It's guaranteed to
+/// communicate using only JSON-serializable values.
+///
+/// Any errors thrown within [getMain], synchronously or not, will be forwarded
+/// to the load test for this suite. Prints will similarly be forwarded to that
+/// test's print stream.
+///
+/// If [hidePrints] is `true` (the default), calls to `print()` within this
+/// suite will not be forwarded to the parent zone's print handler. However, the
+/// caller may want them to be forwarded in (for example) a browser context
+/// where they'll be visible in the development console.
+StreamChannel serializeSuite(AsyncFunction getMain(),
+ {bool hidePrints: true}) =>
+ RemoteListener.start(getMain, hidePrints: hidePrints);
« no previous file with comments | « lib/src/runner/plugin/platform.dart ('k') | lib/src/runner/remote_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine