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

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

Issue 11453027: Fixed a lot of dartanalyzer static analysis issues with the html lib. (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
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('keys', () { 17 test('keys', () {
18 // This test currently is pretty much a no-op because we 18 // This test currently is pretty much a no-op because we
19 // can't (right now) construct KeyboardEvents with specific keycode/charcode 19 // can't (right now) construct KeyboardEvents with specific keycode/charcode
20 // values (a KeyboardEvent can be "init"-ed but not all the information can 20 // 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 21 // be programmatically populated. It exists as an example for how to use
22 // KeyboardEventController more than anything else. 22 // KeyboardEventController more than anything else.
23 var controller = new KeyboardEventController.keydown(document.window); 23 var controller = new KeyboardEventController.keydown(document.query('body')) ;
24 var func = keydownHandlerTest; 24 var func = keydownHandlerTest;
25 controller.add(func); 25 controller.add(func);
26 document.window.on.keyDown.add((e) => print('regular listener'), false); 26 document.query('body').on.keyDown.add((e) => print('regular listener'), fals e);
blois 2012/12/06 18:23:12 document.body?
Emily Fortuna 2012/12/06 18:27:49 It's "hidden" as $dom_body these days, so I though
27 }); 27 });
28 } 28 }
29 29
30 30
OLDNEW
« sdk/lib/html/src/dartium_KeyEvent.dart ('K') | « sdk/lib/html/src/dartium_KeyEvent.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698