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

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: moved instance variables to constructor 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
« no previous file with comments | « sdk/lib/html/templates/html/impl/impl_UIEvent.darttemplate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4f32f2dd1958523c851b4836dfd4b611d890a83e
--- /dev/null
+++ b/tests/html/keyboard_event_test.dart
@@ -0,0 +1,30 @@
+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) {
+ expect(e.charCode, 0);
+ }
+
+ test('keys', () {
+ // This test currently is pretty much a no-op because we
+ // can't (right now) construct KeyboardEvents with specific keycode/charcode
+ // values (a KeyboardEvent can be "init"-ed but not all the information can
+ // be programmatically populated. It exists as an example for how to use
+ // KeyboardEventController more than anything else.
+ var controller = new KeyboardEventController.keydown(document.window);
+ var func = keydownHandlerTest;
+ controller.add(func);
+ document.window.on.keyDown.add((e) => print('regular listener'), false);
+ });
+}
+
+
« no previous file with comments | « sdk/lib/html/templates/html/impl/impl_UIEvent.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698