OLD | NEW |
1 library KeyboardEventTest; | 1 library KeyboardEventTest; |
2 import '../../pkg/unittest/lib/unittest.dart'; | 2 import 'package:unittest/unittest.dart'; |
3 import '../../pkg/unittest/lib/html_config.dart'; | 3 import 'package:unittest/html_config.dart'; |
4 import 'dart:html'; | 4 import 'dart:html'; |
5 | 5 |
6 // Test that we are correctly determining keyCode and charCode uniformly across | 6 // Test that we are correctly determining keyCode and charCode uniformly across |
7 // browsers. | 7 // browsers. |
8 | 8 |
9 main() { | 9 main() { |
10 | 10 |
11 useHtmlConfiguration(); | 11 useHtmlConfiguration(); |
12 | 12 |
13 keydownHandlerTest(KeyEvent e) { | 13 keydownHandlerTest(KeyEvent e) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 test('KeyEventKeyboardEvent', () { | 86 test('KeyEventKeyboardEvent', () { |
87 window.onKeyDown.listen(expectAsync((KeyboardEvent event) { | 87 window.onKeyDown.listen(expectAsync((KeyboardEvent event) { |
88 expect(event.keyCode, 16); | 88 expect(event.keyCode, 16); |
89 })); | 89 })); |
90 var streamDown = KeyEvent.keyDownEvent.forTarget(document.body); | 90 var streamDown = KeyEvent.keyDownEvent.forTarget(document.body); |
91 streamDown.add(new KeyEvent('keydown', keyCode: 16, charCode: 0)); | 91 streamDown.add(new KeyEvent('keydown', keyCode: 16, charCode: 0)); |
92 }); | 92 }); |
93 } | 93 } |
94 | 94 |
95 | 95 |
OLD | NEW |