| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library tests.html.events_test; | 5 library tests.html.events_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 import 'package:unittest/html_config.dart'; | 10 import 'package:unittest/html_config.dart'; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // rely on this. We therefore wrap it into an expectAsync0. | 90 // rely on this. We therefore wrap it into an expectAsync0. |
| 91 runZoned(expectAsync0(() { | 91 runZoned(expectAsync0(() { |
| 92 Zone zone = Zone.current; | 92 Zone zone = Zone.current; |
| 93 expect(zone, isNot(equals(Zone.ROOT))); | 93 expect(zone, isNot(equals(Zone.ROOT))); |
| 94 | 94 |
| 95 var sub; | 95 var sub; |
| 96 | 96 |
| 97 void handler(Event e) { | 97 void handler(Event e) { |
| 98 expect(Zone.current, equals(zone)); | 98 expect(Zone.current, equals(zone)); |
| 99 | 99 |
| 100 runAsync(expectAsync0(() { | 100 scheduleMicrotask(expectAsync0(() { |
| 101 expect(Zone.current, equals(zone)); | 101 expect(Zone.current, equals(zone)); |
| 102 sub.cancel(); | 102 sub.cancel(); |
| 103 })); | 103 })); |
| 104 } | 104 } |
| 105 | 105 |
| 106 sub = element.on['test'].listen(expectAsync1(handler)); | 106 sub = element.on['test'].listen(expectAsync1(handler)); |
| 107 })); | 107 })); |
| 108 element.dispatchEvent(new Event('test')); | 108 element.dispatchEvent(new Event('test')); |
| 109 }); | 109 }); |
| 110 } | 110 } |
| OLD | NEW |