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

Unified Diff: tests/isolate/function_send_test.dart

Issue 579913004: Update test so it doens't leave isolates hanging. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/isolate/isolate.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/function_send_test.dart
diff --git a/tests/isolate/function_send_test.dart b/tests/isolate/function_send_test.dart
index 954a6b4cc444e6cafb8ce72ba1f9f3adccd8908d..95f4f93171c7156e03a8a27da80eae206da08bff 100644
--- a/tests/isolate/function_send_test.dart
+++ b/tests/isolate/function_send_test.dart
@@ -33,7 +33,6 @@ void main() {
// Sendables are top-level functions and static functions only.
testSendable("toplevel", toplevel);
testSendable("static", C.staticFunc);
-
// Unsendables are any closure - instance methods or function expression.
var c = new C();
testUnsendable("instance method", c.instanceMethod);
@@ -65,6 +64,7 @@ void main() {
// not a top-level or static function, so it should be blocked, just as
// a normal method.
testUnsendable("callable object", new Callable().call);
+
asyncEnd();
return;
}
@@ -142,10 +142,6 @@ Future<SendPort> callPort() {
void _call(initPort) {
initPort.send(singleMessagePort(callFunc));
}
- // Expect.throws(() {
- // noReply.sendPort.send([func]);
- // }, null, "send wrapped");
-
void testUnsendable(name, func) {
asyncStart();
@@ -171,8 +167,14 @@ void testUnsendable(name, func) {
// Try sending through other isolate.
asyncStart();
- echoPort((_) => throw "unreachable")
- .then((p) => p.send(func))
+ echoPort((v) { Expect.equals(0, v); })
+ .then((p) {
+ try {
+ p.send(func);
+ } finally {
+ p.send(0); // Closes echo port.
+ }
+ })
.then((p) => throw "unreachable 2",
onError: (e, s) {asyncEnd();});
}
« no previous file with comments | « no previous file | tests/isolate/isolate.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698