| OLD | NEW |
| (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 } |
| OLD | NEW |