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

Unified Diff: tests/lib/async/zone_run_test.dart

Issue 136113014: Introduce and use Zone:_enter and Zone:_leave, in Future. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make futures faster and add a simple test. Created 6 years, 11 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
« sdk/lib/async/future_impl.dart ('K') | « sdk/lib/async/zone.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/zone_run_test.dart
diff --git a/tests/lib/async/zone_run_test.dart b/tests/lib/async/zone_run_test.dart
index 3c13c469f082de94000e2b5b1fc4e82eb922232a..28bd2b798c6a350015b38d96a18a2f61051e90c1 100644
--- a/tests/lib/async/zone_run_test.dart
+++ b/tests/lib/async/zone_run_test.dart
@@ -62,4 +62,25 @@ main() {
events);
asyncEnd();
});
+
+ var zone1 = Zone.ROOT.fork();
+ var zone2 = Zone.ROOT.fork();
+ var zone3 = Zone.ROOT.fork();
+ asyncStart();
+ asyncStart();
+ zone1.run(() {
+ var future = new Future.value();
+ zone2.run(() {
+ future.then((_) {
+ Expect.identical(zone2, Zone.current);
+ asyncEnd();
+ });
+ });
+ zone3.run(() {
+ future.then((_) {
+ Expect.identical(zone3, Zone.current);
+ asyncEnd();
+ });
+ });
+ });
}
« sdk/lib/async/future_impl.dart ('K') | « sdk/lib/async/zone.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698