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

Unified Diff: tests/isolate/static_function_test.dart

Issue 88783002: Isolate.spawn{Uri} only reports errors asynchronously. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years 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/co19/co19-runtime.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/static_function_test.dart
diff --git a/tests/isolate/static_function_test.dart b/tests/isolate/static_function_test.dart
index db0beba16763cff1abccfd1b02a09e9430685042..28e06b477ba2be05aeca889a06053cd8181de20f 100644
--- a/tests/isolate/static_function_test.dart
+++ b/tests/isolate/static_function_test.dart
@@ -70,9 +70,11 @@ void spawnTest(name, function, response) {
});
}
-void throwsTest(name, function) {
+void functionFailTest(name, function) {
test("throws on $name", () {
- expect(() { Isolate.spawn(function, null); }, throws);
+ Isolate.spawn(function, null).catchError(expectAsync1((e) {
+ /* do nothing */
+ }));
});
}
@@ -97,12 +99,14 @@ void main([args, port]) {
spawnTest("lib._class._function", lib.privateClassAndFunction, "_LIBPRIVATE");
// Negative tests
- throwsTest("static closure", staticClosure);
- throwsTest("dynamic closure", dynamicClosure);
- throwsTest("named dynamic closure", namedDynamicClosure);
- throwsTest("instance closure", new C().instanceClosure);
- throwsTest("initializer closure", new C().constructorInitializerClosure);
- throwsTest("constructor closure", new C().constructorBodyClosure);
- throwsTest("named constructor closure", new C().namedConstructorBodyClosure);
- throwsTest("instance method", new C().instanceMethod);
+ functionFailTest("static closure", staticClosure);
+ functionFailTest("dynamic closure", dynamicClosure);
+ functionFailTest("named dynamic closure", namedDynamicClosure);
+ functionFailTest("instance closure", new C().instanceClosure);
+ functionFailTest("initializer closure",
+ new C().constructorInitializerClosure);
+ functionFailTest("constructor closure", new C().constructorBodyClosure);
+ functionFailTest("named constructor closure",
+ new C().namedConstructorBodyClosure);
+ functionFailTest("instance method", new C().instanceMethod);
}
« no previous file with comments | « tests/co19/co19-runtime.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698