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

Unified Diff: tests/isolate/issue_21398_parent_isolate_test.dart

Issue 1477043002: Fix tests that don't catch asynchronous errors from isolate spawning. Update co19 status. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/isolate/issue_21398_parent_isolate2_test.dart ('k') | tests/isolate/message_enum_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/issue_21398_parent_isolate_test.dart
diff --git a/tests/isolate/issue_21398_parent_isolate_test.dart b/tests/isolate/issue_21398_parent_isolate_test.dart
index fb4b0fb6fd0ba3a7a44de11c89cb74ae1956a4d2..76e7e0d4436b57a3762453270ec48b04215e6650 100644
--- a/tests/isolate/issue_21398_parent_isolate_test.dart
+++ b/tests/isolate/issue_21398_parent_isolate_test.dart
@@ -9,6 +9,7 @@
import 'dart:isolate';
import 'dart:async';
import "package:expect/expect.dart";
+import 'package:async_helper/async_helper.dart';
class FromMainIsolate {
String toString() => 'from main isolate';
@@ -29,13 +30,16 @@ main() {
// First spawn an isolate using spawnURI and have it
// send back a "non-literal" like object.
+ asyncStart();
Isolate.spawnUri(Uri.parse('issue_21398_child_isolate.dart'),
[],
[new FromMainIsolate(), receive1.sendPort]).catchError(
(error) {
Expect.isTrue(error is ArgumentError);
+ asyncEnd();
}
);
+ asyncStart();
Isolate.spawnUri(Uri.parse('issue_21398_child_isolate.dart'),
[],
receive1.sendPort).then(
@@ -44,6 +48,7 @@ main() {
(msg) {
Expect.stringEquals(msg, "Invalid Argument(s).");
receive1.close();
+ asyncEnd();
},
onError: (e) => print('$e')
);
@@ -53,7 +58,8 @@ main() {
// Now spawn an isolate using spawnFunction and send it a "non-literal"
// like object and also have the child isolate send back a "non-literal"
// like object.
- Isolate.spawn(funcChild,
+ asyncStart();
+ Isolate.spawn(funcChild,
[new FromMainIsolate(), receive2.sendPort]).then(
(isolate) {
receive2.listen(
@@ -61,6 +67,7 @@ main() {
Expect.isTrue(msg is FromMainIsolate);
Expect.equals(10, msg.fld);
receive2.close();
+ asyncEnd();
},
onError: (e) => print('$e')
);
« no previous file with comments | « tests/isolate/issue_21398_parent_isolate2_test.dart ('k') | tests/isolate/message_enum_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698