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

Side by Side Diff: tests/lib/async/intercept_run_async2_test.dart

Issue 17672002: Add runAsync interceptor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "package:expect/expect.dart";
6 import 'dart:async';
7
8 var events = [];
9
10 body() {
11 events.add("body entry");
12 runAsync(() {
13 events.add("run async body");
14 });
15 return 499;
16 }
17
18 handler(fun) {
19 events.add("handler");
20 fun();
21 events.add("handler done");
22 }
23
24 main() {
25 // Test that runAsync interception works.
26 var result = runZonedExperimental(body, onRunAsync: handler);
27 // No need for a ReceivePort: If the runZonedExperimental disbehaved we
28 // would have an [events] list that is different from what we expect.
29 Expect.listEquals(["body entry", "handler", "run async body", "handler done"],
30 events);
31 }
OLDNEW
« no previous file with comments | « tests/lib/async/intercept_run_async1_test.dart ('k') | tests/lib/async/intercept_run_async3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698