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

Unified Diff: tests/isolate/isolate_throws_test.dart

Issue 92223003: Clean up isolate tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: tests/isolate/isolate_throws_test.dart
diff --git a/tests/isolate/isolate2_negative_test.dart b/tests/isolate/isolate_throws_test.dart
similarity index 58%
rename from tests/isolate/isolate2_negative_test.dart
rename to tests/isolate/isolate_throws_test.dart
index fec12d610fb3f8854c01d44cf4e4baf1b752a6b2..40214fefeff0a2c7a25c7136e12df4fe867b0c9d 100644
--- a/tests/isolate/isolate2_negative_test.dart
+++ b/tests/isolate/isolate_throws_test.dart
@@ -5,18 +5,20 @@
// Dart test program for testing that exceptions in other isolates bring down
// the program.
-library isolate2_negative_test;
import 'dart:isolate';
kustermann 2013/11/28 09:19:47 Keep imports sorted.
floitsch 2013/11/28 14:35:26 Done.
+import 'dart:async';
import "package:async_helper/async_helper.dart";
-void entry(msg) {
- throw "foo";
+void entry(SendPort replyTo) {
+ throw "foo"; /// 01: runtime error
+ replyTo.send("done");
}
main() {
- // We start an asynchronous operation, but since we don't expect to get
- // anything back except an exception there is no asyncEnd().
- // If the exception is not thrown this test will timeout.
asyncStart();
- Isolate.spawn(entry, null);
+ ReceivePort rp = new ReceivePort();
+ Isolate.spawn(entry, rp.sendPort);
+ rp.first.then((_) {
+ asyncEnd();
kustermann 2013/11/28 09:19:47 For the positive test (i.e. the /none test), you s
floitsch 2013/11/28 14:35:26 Done.
+ });
}

Powered by Google App Engine
This is Rietveld 408576698