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

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

Issue 12263046: Fixing DOM's EventStream.isBroadcast (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/EventStreamProvider.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();
(...skipping 18 matching lines...) Expand all
29 29
30 var callCount = 0; 30 var callCount = 0;
31 helper.stream.listen((Event e) { 31 helper.stream.listen((Event e) {
32 ++callCount; 32 ++callCount;
33 }); 33 });
34 34
35 helper.pulse(); 35 helper.pulse();
36 expect(callCount, 1); 36 expect(callCount, 1);
37 }); 37 });
38 38
39 test('broadcast', () {
40 var stream = new DivElement().onClick;
41 expect(stream.asBroadcastStream(), stream);
42 expect(stream.isBroadcast, isTrue);
43 });
44
39 // Validates that capturing events fire on parent before child. 45 // Validates that capturing events fire on parent before child.
40 test('capture', () { 46 test('capture', () {
41 var parent = new DivElement(); 47 var parent = new DivElement();
42 document.body.append(parent); 48 document.body.append(parent);
43 49
44 var helper = new StreamHelper(); 50 var helper = new StreamHelper();
45 parent.append(helper.element); 51 parent.append(helper.element);
46 52
47 var childCallCount = 0; 53 var childCallCount = 0;
48 var parentCallCount = 0; 54 var parentCallCount = 0;
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 }); 276 });
271 277
272 test('singleMatching', () { 278 test('singleMatching', () {
273 stream.singleMatching((_) => true).then((_) {}); 279 stream.singleMatching((_) => true).then((_) {});
274 }); 280 });
275 281
276 test('elementAt', () { 282 test('elementAt', () {
277 stream.elementAt(0).then((_) {}); 283 stream.elementAt(0).then((_) {});
278 }); 284 });
279 } 285 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/EventStreamProvider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698