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

Side by Side Diff: pkg/scheduled_test/test/metatest.dart

Issue 52723007: Revert "Change dart:io Platform.script to return a Uri." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « pkg/http_server/test/utils.dart ('k') | pkg/scheduled_test/test/scheduled_process_test.dart » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /// A test library for testing test libraries? We must go deeper. 5 /// A test library for testing test libraries? We must go deeper.
6 /// 6 ///
7 /// Since unit testing code tends to use a lot of global state, it can be tough 7 /// Since unit testing code tends to use a lot of global state, it can be tough
8 /// to test. This library manages it by running each test case in a child 8 /// to test. This library manages it by running each test case in a child
9 /// isolate, then reporting the results back to the parent isolate. 9 /// isolate, then reporting the results back to the parent isolate.
10 library metatest; 10 library metatest;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 _testToRun = message['testToRun']; 112 _testToRun = message['testToRun'];
113 _replyTo = message['replyTo']; 113 _replyTo = message['replyTo'];
114 _inChildIsolate = true; 114 _inChildIsolate = true;
115 } 115 }
116 } 116 }
117 117
118 /// Runs the test described by [description] in its own isolate. Returns a map 118 /// Runs the test described by [description] in its own isolate. Returns a map
119 /// describing the results of that test run. 119 /// describing the results of that test run.
120 Future<Map> _runInIsolate(String description) { 120 Future<Map> _runInIsolate(String description) {
121 var replyPort = new ReceivePort(); 121 var replyPort = new ReceivePort();
122 return Isolate.spawnUri(Platform.script, [], { 122 return Isolate.spawnUri(Uri.parse(Platform.script), [], {
123 'testToRun': description, 123 'testToRun': description,
124 'replyTo': replyPort.sendPort 124 'replyTo': replyPort.sendPort
125 }).then((_) { 125 }).then((_) {
126 // TODO(nweiz): Remove this timeout once issue 8417 is fixed and we can 126 // TODO(nweiz): Remove this timeout once issue 8417 is fixed and we can
127 // capture top-level exceptions. 127 // capture top-level exceptions.
128 return timeout(replyPort.first, 30 * 1000, () { 128 return timeout(replyPort.first, 30 * 1000, () {
129 throw 'Timed out waiting for test to complete.'; 129 throw 'Timed out waiting for test to complete.';
130 }); 130 });
131 }); 131 });
132 } 132 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 "uncaughtError": uncaughtError, 200 "uncaughtError": uncaughtError,
201 "results": results.map((testCase) => { 201 "results": results.map((testCase) => {
202 "description": testCase.description, 202 "description": testCase.description,
203 "message": testCase.message, 203 "message": testCase.message,
204 "result": testCase.result, 204 "result": testCase.result,
205 "stackTrace": testCase.stackTrace 205 "stackTrace": testCase.stackTrace
206 }).toList() 206 }).toList()
207 }); 207 });
208 } 208 }
209 } 209 }
OLDNEW
« no previous file with comments | « pkg/http_server/test/utils.dart ('k') | pkg/scheduled_test/test/scheduled_process_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698