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

Side by Side Diff: tests/html/keyboard_event_test.dart

Issue 11475033: Fix up DOM keyboardEvent constructor for dartium. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/html/templates/html/dartium/impl_KeyboardEvent.darttemplate ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library KeyboardEventTest; 1 library KeyboardEventTest;
2 import '../../pkg/unittest/lib/unittest.dart'; 2 import '../../pkg/unittest/lib/unittest.dart';
3 import '../../pkg/unittest/lib/html_config.dart'; 3 import '../../pkg/unittest/lib/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) {
14 expect(e.charCode, 0); 14 expect(e.charCode, 0);
15 } 15 }
16 16
17 test('keyboardEvent constructor', () {
18 var event = new KeyboardEvent('keyup', document.window);
Emily Fortuna 2012/12/07 18:29:05 This is the one change that is different from the
19 });
17 test('keys', () { 20 test('keys', () {
18 // This test currently is pretty much a no-op because we 21 // This test currently is pretty much a no-op because we
19 // can't (right now) construct KeyboardEvents with specific keycode/charcode 22 // can't (right now) construct KeyboardEvents with specific keycode/charcode
20 // values (a KeyboardEvent can be "init"-ed but not all the information can 23 // values (a KeyboardEvent can be "init"-ed but not all the information can
21 // be programmatically populated. It exists as an example for how to use 24 // be programmatically populated. It exists as an example for how to use
22 // KeyboardEventController more than anything else. 25 // KeyboardEventController more than anything else.
23 var controller = new KeyboardEventController.keydown(document.body); 26 var controller = new KeyboardEventController.keydown(document.body);
24 var func = keydownHandlerTest; 27 var func = keydownHandlerTest;
25 controller.add(func); 28 controller.add(func);
26 document.body.on.keyDown.add((e) => print('regular listener'), false); 29 document.body.on.keyDown.add((e) => print('regular listener'), false);
27 }); 30 });
28 } 31 }
29 32
30 33
OLDNEW
« no previous file with comments | « sdk/lib/html/templates/html/dartium/impl_KeyboardEvent.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698