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

Side by Side Diff: lib/src/dart.dart

Issue 948113004: Support Dart 1.8.0. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « bin/unittest.dart ('k') | lib/src/io.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) 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 library unittest.dart; 5 library unittest.dart;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:isolate'; 9 import 'dart:isolate';
10 10
(...skipping 18 matching lines...) Expand all
29 new File(dartPath).writeAsStringSync(code); 29 new File(dartPath).writeAsStringSync(code);
30 var port = new ReceivePort(); 30 var port = new ReceivePort();
31 return Isolate.spawn(_isolateBuffer, { 31 return Isolate.spawn(_isolateBuffer, {
32 'replyTo': port.sendPort, 32 'replyTo': port.sendPort,
33 'uri': p.toUri(dartPath).toString(), 33 'uri': p.toUri(dartPath).toString(),
34 'packageRoot': packageRoot == null ? null : packageRoot.toString(), 34 'packageRoot': packageRoot == null ? null : packageRoot.toString(),
35 'message': message 35 'message': message
36 }).then((isolate) { 36 }).then((isolate) {
37 return port.first.then((response) { 37 return port.first.then((response) {
38 if (response['type'] != 'error') return isolate; 38 if (response['type'] != 'error') return isolate;
39 isolate.kill(); 39 if (supportsIsolateKill) isolate.kill();
40 var asyncError = RemoteException.deserialize(response['error']); 40 var asyncError = RemoteException.deserialize(response['error']);
41 return new Future.error(asyncError.error, asyncError.stackTrace); 41 return new Future.error(asyncError.error, asyncError.stackTrace);
42 }); 42 });
43 }).catchError((error) { 43 }).catchError((error) {
44 new Directory(dir).deleteSync(recursive: true); 44 new Directory(dir).deleteSync(recursive: true);
45 throw error; 45 throw error;
46 }).then((isolate) { 46 }).then((isolate) {
47 return new IsolateWrapper(isolate, 47 return new IsolateWrapper(isolate,
48 () => new Directory(dir).deleteSync(recursive: true)); 48 () => new Directory(dir).deleteSync(recursive: true));
49 }); 49 });
(...skipping 12 matching lines...) Expand all
62 Isolate.spawnUri(Uri.parse(message['uri']), [], message['message'], 62 Isolate.spawnUri(Uri.parse(message['uri']), [], message['message'],
63 packageRoot: packageRoot) 63 packageRoot: packageRoot)
64 .then((_) => replyTo.send({'type': 'success'})) 64 .then((_) => replyTo.send({'type': 'success'}))
65 .catchError((error, stackTrace) { 65 .catchError((error, stackTrace) {
66 replyTo.send({ 66 replyTo.send({
67 'type': 'error', 67 'type': 'error',
68 'error': RemoteException.serialize(error, stackTrace) 68 'error': RemoteException.serialize(error, stackTrace)
69 }); 69 });
70 }); 70 });
71 } 71 }
OLDNEW
« no previous file with comments | « bin/unittest.dart ('k') | lib/src/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698