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

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

Issue 14883008: use .append instead of .nodes.add (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: revert node_test and element_test Created 7 years, 7 months 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 | « tests/html/event_test.dart ('k') | tests/html/htmlcollection_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library EventsTest; 1 library EventsTest;
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 main() { 6 main() {
7 useHtmlConfiguration(); 7 useHtmlConfiguration();
8 8
9 test('TimeStamp', () { 9 test('TimeStamp', () {
10 Event event = new Event('test'); 10 Event event = new Event('test');
(...skipping 11 matching lines...) Expand all
22 expect(e.bubbles, bubble, reason: 'canBubble was set to $bubble'); 22 expect(e.bubbles, bubble, reason: 'canBubble was set to $bubble');
23 expect(e.cancelable, cancel, reason: 'cancelable was set to $cancel'); 23 expect(e.cancelable, cancel, reason: 'cancelable was set to $cancel');
24 } 24 }
25 }); 25 });
26 26
27 // The next test is not asynchronous because [on['test'].dispatch(event)] fire s the event 27 // The next test is not asynchronous because [on['test'].dispatch(event)] fire s the event
28 // and event listener synchronously. 28 // and event listener synchronously.
29 test('EventTarget', () { 29 test('EventTarget', () {
30 Element element = new Element.tag('test'); 30 Element element = new Element.tag('test');
31 element.id = 'eventtarget'; 31 element.id = 'eventtarget';
32 window.document.body.nodes.add(element); 32 window.document.body.append(element);
33 33
34 int invocationCounter = 0; 34 int invocationCounter = 0;
35 void handler(Event e) { 35 void handler(Event e) {
36 expect(e.type, equals('test')); 36 expect(e.type, equals('test'));
37 Element target = e.target; 37 Element target = e.target;
38 expect(element, equals(target)); 38 expect(element, equals(target));
39 invocationCounter++; 39 invocationCounter++;
40 } 40 }
41 41
42 Event event = new Event('test'); 42 Event event = new Event('test');
(...skipping 23 matching lines...) Expand all
66 invocationCounter = 0; 66 invocationCounter = 0;
67 element.dispatchEvent(event); 67 element.dispatchEvent(event);
68 expect(invocationCounter, 1); 68 expect(invocationCounter, 1);
69 }); 69 });
70 70
71 test('InitMouseEvent', () { 71 test('InitMouseEvent', () {
72 DivElement div = new Element.tag('div'); 72 DivElement div = new Element.tag('div');
73 MouseEvent event = new MouseEvent('zebra', relatedTarget: div); 73 MouseEvent event = new MouseEvent('zebra', relatedTarget: div);
74 }); 74 });
75 } 75 }
OLDNEW
« no previous file with comments | « tests/html/event_test.dart ('k') | tests/html/htmlcollection_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698