Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1123)

Unified Diff: tests/html/keyboard_event_test.dart

Issue 11416249: Make KeyboardEvent cross-browser consistent. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: addressed blois comments Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ });
+}
+
+

Powered by Google App Engine
This is Rietveld 408576698