Index: tests/html/keyboard_event_test.dart |
diff --git a/tests/html/keyboard_event_test.dart b/tests/html/keyboard_event_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c9057896f5504db9c0b27b972f1d12c684d563c9 |
--- /dev/null |
+++ b/tests/html/keyboard_event_test.dart |
@@ -0,0 +1,27 @@ |
+library KeyboardEventTest; |
+import '../../pkg/unittest/lib/unittest.dart'; |
+import '../../pkg/unittest/lib/html_config.dart'; |
+import 'dart:html'; |
+ |
+// Test that we are correctly determining keyCode and charCode uniformly across |
+// browsers. |
+ |
+main() { |
+ |
+ useHtmlConfiguration(); |
+ |
+ keydownHandlerTest(KeyEvent e) { |
+ print('keycode ${e.keyCode}'); |
blois
2012/11/29 17:06:34
Can you add a comment as to why this doesn't do mu
Emily Fortuna
2012/11/29 19:19:50
Sure... I can just delete the test, because it rea
blois
2012/11/29 21:04:55
It may be handy to keep around for debugging since
|
+ print('charcode ${e.charCode}'); |
+ //expect(e.charCode, 0); |
+ //expect(e.keyCode, 0); |
+ } |
+ |
+ test('keys', () { |
+ var controller = new KeyboardEventController.keydown(document.window); |
+ controller.add(keydownHandlerTest); |
+ document.window.on.keyDown.add((e) => print('regular listener'), false); |
+ }); |
+} |
+ |
+ |