| 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 interactive_test; | 5 library interactive_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import '../../pkg/unittest/lib/unittest.dart'; | 9 import '../../pkg/unittest/lib/unittest.dart'; |
| 10 import '../../pkg/unittest/lib/html_individual_config.dart'; | 10 import '../../pkg/unittest/lib/html_individual_config.dart'; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 '${e.charCode}, KeyCode: ${e.keyCode}<br />'; | 118 '${e.charCode}, KeyCode: ${e.keyCode}<br />'; |
| 119 expect(e.charCode, 0); | 119 expect(e.charCode, 0); |
| 120 } | 120 } |
| 121 test('keys', () { | 121 test('keys', () { |
| 122 document.body.innerHtml = | 122 document.body.innerHtml = |
| 123 '${document.body.innerHtml}To test keyboard event values, press some ' | 123 '${document.body.innerHtml}To test keyboard event values, press some ' |
| 124 'keys on your keyboard.<br /><br />The charcode for keydown and keyup' | 124 'keys on your keyboard.<br /><br />The charcode for keydown and keyup' |
| 125 ' should be 0, and the keycode should (generally) be populated with a' | 125 ' should be 0, and the keycode should (generally) be populated with a' |
| 126 ' value. Keycode and charcode should both have values for the ' | 126 ' value. Keycode and charcode should both have values for the ' |
| 127 'keypress event.'; | 127 'keypress event.'; |
| 128 new KeyboardEventStream.onKeyDown(document.body).listen( | 128 KeyboardEventStream.onKeyDown(document.body).listen( |
| 129 keydownHandlerTest); | 129 keydownHandlerTest); |
| 130 new KeyboardEventStream.onKeyPress(document.body).listen( | 130 KeyboardEventStream.onKeyPress(document.body).listen( |
| 131 keypressHandlerTest); | 131 keypressHandlerTest); |
| 132 new KeyboardEventStream.onKeyUp(document.body).listen( | 132 KeyboardEventStream.onKeyUp(document.body).listen( |
| 133 keyupHandlerTest); | 133 keyupHandlerTest); |
| 134 new KeyboardEventStream.onKeyUp(document.body).listen( | 134 KeyboardEventStream.onKeyUp(document.body).listen( |
| 135 keyupHandlerTest2); | 135 keyupHandlerTest2); |
| 136 }); | 136 }); |
| 137 }); | 137 }); |
| 138 } | 138 } |
| OLD | NEW |