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

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

Issue 12047054: Deprecating old DOM event APIs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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/exceptions_test.dart ('k') | tests/html/wheelevent_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 streams_test; 1 library streams_test;
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:async'; 4 import 'dart:async';
5 import 'dart:html'; 5 import 'dart:html';
6 6
7 class StreamHelper { 7 class StreamHelper {
8 var _a; 8 var _a;
9 StreamHelper() { 9 StreamHelper() {
10 _a = new TextInputElement(); 10 _a = new TextInputElement();
11 document.body.append(_a); 11 document.body.append(_a);
12 } 12 }
13 13
14 Element get element => _a; 14 Element get element => _a;
15 Stream<Event> get stream => _a.onFocus; 15 Stream<Event> get stream => _a.onFocus;
16 16
17 // Causes an event on a to be fired. 17 // Causes an event on a to be fired.
18 void pulse() { 18 void pulse() {
19 var event = new Event('focus'); 19 var event = new Event('focus');
20 _a.$dom_dispatchEvent(event); 20 _a.dispatchEvent(event);
21 } 21 }
22 } 22 }
23 23
24 main() { 24 main() {
25 useHtmlConfiguration(); 25 useHtmlConfiguration();
26 26
27 test('simple', () { 27 test('simple', () {
28 var helper = new StreamHelper(); 28 var helper = new StreamHelper();
29 29
30 var callCount = 0; 30 var callCount = 0;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 ++callCountOne; 163 ++callCountOne;
164 }); 164 });
165 helper.pulse(); 165 helper.pulse();
166 expect(callCountOne, 1); 166 expect(callCountOne, 1);
167 167
168 subscription.onData(null); 168 subscription.onData(null);
169 helper.pulse(); 169 helper.pulse();
170 expect(callCountOne, 1); 170 expect(callCountOne, 1);
171 }); 171 });
172 } 172 }
OLDNEW
« no previous file with comments | « tests/html/exceptions_test.dart ('k') | tests/html/wheelevent_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698