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

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

Issue 2875773003: Roll 50: Updated for push to origin/master. (Closed)
Patch Set: Roll 50: Updated to latest Created 3 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library tests.html.events_test; 5 library tests.html.events_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 import 'package:unittest/html_config.dart'; 10 import 'package:unittest/html_config.dart';
11 11
12 main() { 12 main() {
13 useHtmlConfiguration(); 13 useHtmlConfiguration();
14 14
15 test('TimeStamp', () { 15 test('TimeStamp', () {
16 Event event = new Event('test'); 16 Event event = new Event('test');
17 17
18 int timeStamp = event.timeStamp; 18 num timeStamp = event.timeStamp;
19 expect(timeStamp, greaterThan(0)); 19 expect(timeStamp, greaterThan(0));
20 }); 20 });
21 21
22 test('Event canBubble and cancelable', () { 22 test('Event canBubble and cancelable', () {
23 // Try every combination of canBubble and cancelable 23 // Try every combination of canBubble and cancelable
24 for (var i = 0; i < 4; i++) { 24 for (var i = 0; i < 4; i++) {
25 var bubble = (i & 1) != 0; 25 var bubble = (i & 1) != 0;
26 var cancel = (i & 2) != 0; 26 var cancel = (i & 2) != 0;
27 var e = new Event('input', canBubble: bubble, cancelable: cancel); 27 var e = new Event('input', canBubble: bubble, cancelable: cancel);
28 expect(e.bubbles, bubble, reason: 'canBubble was set to $bubble'); 28 expect(e.bubbles, bubble, reason: 'canBubble was set to $bubble');
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 expect(Zone.current, equals(zone)); 110 expect(Zone.current, equals(zone));
111 sub.cancel(); 111 sub.cancel();
112 })); 112 }));
113 } 113 }
114 114
115 sub = element.on['test'].listen(expectAsync(handler)); 115 sub = element.on['test'].listen(expectAsync(handler));
116 })); 116 }));
117 element.dispatchEvent(new Event('test')); 117 element.dispatchEvent(new Event('test'));
118 }); 118 });
119 } 119 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698