Chromium Code Reviews| Index: tests/lib/async/intercept_run_async2_test.dart |
| diff --git a/tests/lib/async/intercept_run_async2_test.dart b/tests/lib/async/intercept_run_async2_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ddc1bbf18813489ccdb70d0ae8151378497472fc |
| --- /dev/null |
| +++ b/tests/lib/async/intercept_run_async2_test.dart |
| @@ -0,0 +1,30 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +import "package:expect/expect.dart"; |
| +import 'dart:async'; |
| +import 'dart:isolate'; |
| + |
| +var events = []; |
| + |
| +body() { |
| + events.add("body entry"); |
| + runAsync(() { |
| + events.add("run async body"); |
| + }); |
| + return 499; |
| +} |
| + |
| +handler(fun) { |
| + events.add("handler"); |
| + fun(); |
| + events.add("handler done"); |
| +} |
| + |
| +main() { |
|
Lasse Reichstein Nielsen
2013/06/26 09:24:29
No receiveport?
floitsch
2013/06/26 12:22:56
Not needed. Added comment.
|
| + // Test that runAsync interception works. |
| + var result = runZonedExperimental(body, onRunAsync: handler); |
| + Expect.listEquals(["body entry", "handler", "run async body", "handler done"], |
| + events); |
| +} |