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

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

Issue 941123002: Get all tests running via the test runner. (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 | « lib/src/dart.dart ('k') | test/invoker_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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library unittest.isolate_wrapper;
6
7 import 'dart:isolate';
8
9 // TODO(nweiz): Get rid of this when issue 6610 is fixed.
10 /// This is a wrapper around an [Isolate] that supports a callback that will
11 /// fire when [Isolate.exit] is called.
12 ///
13 /// This is necessary to delete the source directory of the isolate only once
14 /// the Isolate completes. Note that the callback won't necessarily fire before
15 /// the Isolate is killed, but it comes close enough for our purposes.
16 class IsolateWrapper implements Isolate {
17 final Isolate _inner;
18
19 final Function _onExit;
20
21 SendPort get controlPort => _inner.controlPort;
22 Stream get errors => _inner.errors;
23 Capability get terminateCapability => _inner.terminateCapability;
24
25 IsolateWrapper(this._inner, this._onExit);
26
27 void addErrorListener(SendPort port) => _inner.addErrorListener(port);
28 void addOnExitListener(SendPort port) => _inner.addOnExitListener(port);
29 Capability pause([Capability resumeCapability]) =>
30 _inner.pause(resumeCapability);
31 void ping(SendPort responsePort, [int pingType=Isolate.IMMEDIATE]) =>
32 _inner.ping(responsePort, pingType);
33 void removeErrorListener(SendPort port) => _inner.removeErrorListener(port);
34 void removeOnExitListener(SendPort port) => _inner.removeOnExitListener(port);
35 void resume(Capability resumeCapability) => _inner.resume(resumeCapability);
36 void setErrorsFatal(bool errorsAreFatal) =>
37 _inner.setErrorsFatal(errorsAreFatal);
38 String toString() => _inner.toString();
39
40 void kill([int priority=Isolate.BEFORE_NEXT_EVENT]) {
41 _inner.kill(priority);
42 _onExit();
43 }
44 }
OLDNEW
« no previous file with comments | « lib/src/dart.dart ('k') | test/invoker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698