Index: tests/lib/async/stack_trace11_test.dart |
diff --git a/tests/lib/async/zone_root_bind_test.dart b/tests/lib/async/stack_trace11_test.dart |
similarity index 51% |
copy from tests/lib/async/zone_root_bind_test.dart |
copy to tests/lib/async/stack_trace11_test.dart |
index 7b73f9851514f2a7bab8e72825cb6d4626bb15b5..d72b50f36cadfac72d7fe8cee52407591208612f 100644 |
--- a/tests/lib/async/zone_root_bind_test.dart |
+++ b/tests/lib/async/stack_trace11_test.dart |
@@ -6,13 +6,21 @@ import 'package:expect/expect.dart'; |
import 'package:async_helper/async_helper.dart'; |
import 'dart:async'; |
+StackTrace captureStackTrace() { |
+ try { |
+ throw 0; |
+ } catch (e, st) { |
+ return st; |
+ } |
+} |
+ |
main() { |
- Expect.identical(Zone.ROOT, Zone.current); |
- Zone forked = Zone.current.fork(); |
- var f = Zone.current.bindCallback(() { |
- Expect.identical(Zone.ROOT, Zone.current); |
- }, runGuarded: false); |
- forked.run(() { |
- f(); |
- }); |
-} |
+ StackTrace trace = captureStackTrace(); |
+ asyncStart(); |
+ var f = new Future.error(499, trace); |
+ f.then((_) { throw "Unreachable"; }, |
+ onError: (e, st) { |
+ Expect.identical(trace, st); |
+ asyncEnd(); |
+ }); |
+} |