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

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

Issue 1894713002: Strong html (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: ptal Created 4 years, 8 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
« no previous file with comments | « tests/html/element_test.dart ('k') | tools/dom/idl/dart/dart.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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';
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 expect(element, equals(target)); 44 expect(element, equals(target));
45 invocationCounter++; 45 invocationCounter++;
46 } 46 }
47 47
48 Event event = new Event('test'); 48 Event event = new Event('test');
49 49
50 invocationCounter = 0; 50 invocationCounter = 0;
51 element.dispatchEvent(event); 51 element.dispatchEvent(event);
52 expect(invocationCounter, isZero); 52 expect(invocationCounter, isZero);
53 53
54 var provider = new EventStreamProvider<CustomEvent>('test'); 54 var provider = new EventStreamProvider<Event>('test');
55 55
56 var sub = provider.forTarget(element).listen(handler); 56 var sub = provider.forTarget(element).listen(handler);
57 invocationCounter = 0; 57 invocationCounter = 0;
58 element.dispatchEvent(event); 58 element.dispatchEvent(event);
59 expect(invocationCounter, 1); 59 expect(invocationCounter, 1);
60 60
61 sub.cancel(); 61 sub.cancel();
62 invocationCounter = 0; 62 invocationCounter = 0;
63 element.dispatchEvent(event); 63 element.dispatchEvent(event);
64 expect(invocationCounter, isZero); 64 expect(invocationCounter, isZero);
(...skipping 45 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
« no previous file with comments | « tests/html/element_test.dart ('k') | tools/dom/idl/dart/dart.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698