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

Unified Diff: tests/html/events_test.dart

Issue 12040059: Converting tests over to using event streams. (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 side-by-side diff with in-line comments
Download patch
Index: tests/html/events_test.dart
diff --git a/tests/html/events_test.dart b/tests/html/events_test.dart
index 11a962398cc28ba6e454b87871a98feb268ed075..a88d63196f48700ac9c601f1cd0026a40063da5e 100644
--- a/tests/html/events_test.dart
+++ b/tests/html/events_test.dart
@@ -29,27 +29,29 @@ main() {
Event event = new Event('test');
invocationCounter = 0;
- element.on['test'].dispatch(event);
+ element.dispatchEvent(event);
expect(invocationCounter, isZero);
- element.on['test'].add(handler, false);
+ var provider = new EventStreamProvider<CustomEvent>('test');
+
+ var sub = provider.forTarget(element).listen(handler);
invocationCounter = 0;
- element.on['test'].dispatch(event);
+ element.dispatchEvent(event);
expect(invocationCounter, 1);
- element.on['test'].remove(handler, false);
+ sub.cancel();
invocationCounter = 0;
- element.on['test'].dispatch(event);
+ element.dispatchEvent(event);
expect(invocationCounter, isZero);
- element.on['test'].add(handler, false);
+ provider.forTarget(element).listen(handler);
invocationCounter = 0;
- element.on['test'].dispatch(event);
+ element.dispatchEvent(event);
expect(invocationCounter, 1);
- element.on['test'].add(handler, false);
+ provider.forTarget(element).listen(handler);
invocationCounter = 0;
- element.on['test'].dispatch(event);
+ element.dispatchEvent(event);
expect(invocationCounter, 1);
});
test('InitMouseEvent', () {

Powered by Google App Engine
This is Rietveld 408576698