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

Unified Diff: lib/pub_serve.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. 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/backend/invoker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/pub_serve.dart
diff --git a/lib/pub_serve.dart b/lib/pub_serve.dart
index cf96c135f62f81c66ffe91717cabb111a5fd6f35..f1fa8c7bde9ef8d2f45fea38f0a29313631a075e 100644
--- a/lib/pub_serve.dart
+++ b/lib/pub_serve.dart
@@ -29,17 +29,23 @@ class PubServeTransformer extends Transformer implements DeclaringTransformer {
transform.addOutput(
new Asset.fromString(id.addExtension('.vm_test.dart'), '''
-import "package:test/src/backend/metadata.dart";
-import "package:test/src/runner/vm/isolate_listener.dart";
+ import "dart:isolate";
-import "${p.url.basename(id.path)}" as test;
+ import "package:stream_channel/stream_channel.dart";
-void main(_, Map message) {
- var sendPort = message['reply'];
- var metadata = new Metadata.deserialize(message['metadata']);
- IsolateListener.start(sendPort, metadata, () => test.main);
-}
-'''));
+ import "package:test/src/runner/plugin/remote_platform_helpers.dart";
+ import "package:test/src/runner/vm/catch_isolate_errors.dart";
+
+ import "${p.url.basename(id.path)}" as test;
+
+ void main(_, SendPort message) {
+ var channel = serializeSuite(() {
+ catchIsolateErrors();
+ return test.main;
+ });
+ new IsolateChannel.connectSend(message).pipe(channel);
+ }
+ '''));
transform.addOutput(
new Asset.fromString(id.addExtension('.browser_test.dart'), '''
« no previous file with comments | « no previous file | lib/src/backend/invoker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698