OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 import 'dart:html'; | 5 import 'dart:html'; |
6 | 6 |
7 import 'package:minitest/minitest.dart'; | 7 import 'package:expect/minitest.dart'; |
8 | 8 |
9 eventTest(String name, Event eventFn(), void validate(Event), | 9 eventTest(String name, Event eventFn(), void validate(Event), |
10 [String type = 'foo']) { | 10 [String type = 'foo']) { |
11 test(name, () { | 11 test(name, () { |
12 final el = new Element.tag('div'); | 12 final el = new Element.tag('div'); |
13 var fired = false; | 13 var fired = false; |
14 el.on[type].listen((ev) { | 14 el.on[type].listen((ev) { |
15 fired = true; | 15 fired = true; |
16 validate(ev); | 16 validate(ev); |
17 }); | 17 }); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 expect(ev.screen.x, 3); | 184 expect(ev.screen.x, 3); |
185 expect(ev.screen.y, 4); | 185 expect(ev.screen.y, 4); |
186 expect(ev.client.x, 5); | 186 expect(ev.client.x, 5); |
187 expect(ev.client.y, 6); | 187 expect(ev.client.y, 6); |
188 expect(ev.ctrlKey, isTrue); | 188 expect(ev.ctrlKey, isTrue); |
189 expect(ev.altKey, isTrue); | 189 expect(ev.altKey, isTrue); |
190 expect(ev.shiftKey, isTrue); | 190 expect(ev.shiftKey, isTrue); |
191 expect(ev.metaKey, isTrue); | 191 expect(ev.metaKey, isTrue); |
192 }, 'mousewheel'); | 192 }, 'mousewheel'); |
193 } | 193 } |
OLD | NEW |