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

Unified Diff: tests/isolate/exit_at_spawn_test.dart

Issue 1294803003: Implement new parameters on Isolate.spawn() for dart2js. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Make tests succeed. Created 5 years, 4 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 | « sdk/lib/_internal/js_runtime/lib/isolate_patch.dart ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/exit_at_spawn_test.dart
diff --git a/tests/isolate/exit_at_spawn_test.dart b/tests/isolate/exit_at_spawn_test.dart
index a03b565b0042d774622888561f77c27f9e10ba9d..355c449607ed720188e22978c42c07fa9f29ba95 100644
--- a/tests/isolate/exit_at_spawn_test.dart
+++ b/tests/isolate/exit_at_spawn_test.dart
@@ -9,19 +9,40 @@ import "dart:async";
import "package:async_helper/async_helper.dart";
import "package:expect/expect.dart";
+// Isolate exiting immediately.
isomain(args) {}
+// Isolate exiting after running microtasks.
+isomain2(args) {
+ scheduleMicrotask((){});
+}
+
+// Isolate exiting after running timers.
+isomain3(args) {
+ new Timer(Duration.ZERO, (){});
+}
+
main(){
asyncStart();
+ test(isomain);
+ test(isomain2);
+ test(isomain3);
+
+ asyncEnd();
+}
+
+void test(mainFunction) {
+ asyncStart();
+
RawReceivePort exitPort = new RawReceivePort();
exitPort.handler = (message) {
Expect.equals(null, message);
exitPort.close();
asyncEnd();
};
-
- Isolate.spawn(isomain,
+
+ Isolate.spawn(mainFunction,
null,
// Setup handler as part of spawn.
errorsAreFatal: false,
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/isolate_patch.dart ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698