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

Side by Side Diff: test/runner/isolate_listener_test.dart

Issue 1085883003: Make IsolateWrapper compatible with the 1.11 isolate API changes. (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 | « lib/src/util/isolate_wrapper.dart ('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 @TestOn("vm") 5 @TestOn("vm")
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 9
10 import 'package:test/src/backend/invoker.dart'; 10 import 'package:test/src/backend/invoker.dart';
(...skipping 15 matching lines...) Expand all
26 Isolate _isolate; 26 Isolate _isolate;
27 27
28 /// A live test that's running for the current test. 28 /// A live test that's running for the current test.
29 /// 29 ///
30 /// This is tracked so that it can be closed once the test is done. 30 /// This is tracked so that it can be closed once the test is done.
31 LiveTest _liveTest; 31 LiveTest _liveTest;
32 32
33 void main() { 33 void main() {
34 tearDown(() { 34 tearDown(() {
35 if (_isolate != null && supportsIsolateKill) { 35 if (_isolate != null && supportsIsolateKill) {
36 _isolate.kill(Isolate.IMMEDIATE); 36 _isolate.kill();
37 } 37 }
38 _isolate = null; 38 _isolate = null;
39 39
40 if (_liveTest != null) _liveTest.close(); 40 if (_liveTest != null) _liveTest.close();
41 _liveTest = null; 41 _liveTest = null;
42 }); 42 });
43 43
44 test("sends a list of available tests on startup", () { 44 test("sends a list of available tests on startup", () {
45 return _spawnIsolate(_successfulTests).then((receivePort) { 45 return _spawnIsolate(_successfulTests).then((receivePort) {
46 return receivePort.first; 46 return receivePort.first;
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 /// An isolate entrypoint that defines a test that prints twice. 393 /// An isolate entrypoint that defines a test that prints twice.
394 void _printTest(SendPort sendPort) { 394 void _printTest(SendPort sendPort) {
395 IsolateListener.start(sendPort, () => () { 395 IsolateListener.start(sendPort, () => () {
396 test("prints", () { 396 test("prints", () {
397 print("Hello,"); 397 print("Hello,");
398 return new Future(() => print("world!")); 398 return new Future(() => print("world!"));
399 }); 399 });
400 }); 400 });
401 } 401 }
402 402
OLDNEW
« no previous file with comments | « lib/src/util/isolate_wrapper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698