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

Side by Side Diff: lib/pub_serve.dart

Issue 1095693002: Fix "pub serve" for VM tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « CHANGELOG.md ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:convert'; 5 import 'dart:convert';
6 6
7 import 'package:barback/barback.dart'; 7 import 'package:barback/barback.dart';
8 import 'package:path/path.dart' as p; 8 import 'package:path/path.dart' as p;
9 9
10 /// A transformer that injects bootstrapping code used by the test runner to run 10 /// A transformer that injects bootstrapping code used by the test runner to run
(...skipping 11 matching lines...) Expand all
22 transform.declareOutput(id.addExtension('.vm_test.dart')); 22 transform.declareOutput(id.addExtension('.vm_test.dart'));
23 transform.declareOutput(id.addExtension('.browser_test.dart')); 23 transform.declareOutput(id.addExtension('.browser_test.dart'));
24 transform.declareOutput(id.addExtension('.browser_test.html')); 24 transform.declareOutput(id.addExtension('.browser_test.html'));
25 } 25 }
26 26
27 void apply(Transform transform) { 27 void apply(Transform transform) {
28 var id = transform.primaryInput.id; 28 var id = transform.primaryInput.id;
29 29
30 transform.addOutput( 30 transform.addOutput(
31 new Asset.fromString(id.addExtension('.vm_test.dart'), ''' 31 new Asset.fromString(id.addExtension('.vm_test.dart'), '''
32 import "package:test/src/backend/metadata.dart";
32 import "package:test/src/runner/vm/isolate_listener.dart"; 33 import "package:test/src/runner/vm/isolate_listener.dart";
33 34
34 import "${p.url.basename(id.path)}" as test; 35 import "${p.url.basename(id.path)}" as test;
35 36
36 void main(_, Map message) { 37 void main(_, Map message) {
37 var sendPort = message['reply']; 38 var sendPort = message['reply'];
38 var metadata = new Metadata.deserialize(message['metadata']); 39 var metadata = new Metadata.deserialize(message['metadata']);
39 IsolateListener.start(sendPort, metadata, () => test.main); 40 IsolateListener.start(sendPort, metadata, () => test.main);
40 } 41 }
41 ''')); 42 '''));
(...skipping 15 matching lines...) Expand all
57 <html> 58 <html>
58 <head> 59 <head>
59 <title>${HTML_ESCAPE.convert(id.path)} Test</title> 60 <title>${HTML_ESCAPE.convert(id.path)} Test</title>
60 <script src="${HTML_ESCAPE.convert(p.url.basename(browserId.path))}.js"> 61 <script src="${HTML_ESCAPE.convert(p.url.basename(browserId.path))}.js">
61 </script> 62 </script>
62 </head> 63 </head>
63 </html> 64 </html>
64 ''')); 65 '''));
65 } 66 }
66 } 67 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698