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

Unified Diff: tests/html/event_customevent_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/event_customevent_test.dart
diff --git a/tests/html/event_customevent_test.dart b/tests/html/event_customevent_test.dart
index 2f506278320d24164e962aee02077f7e18bd0708..4e0ed4860202ae5b1a6673146a71b3dec6ebbf4c 100644
--- a/tests/html/event_customevent_test.dart
+++ b/tests/html/event_customevent_test.dart
@@ -26,9 +26,19 @@ eventTest(String name, Event eventFn(), void validate(Event),
main() {
useHtmlConfiguration();
- eventTest('CustomEvent.initCustomEvent', () {
- return new CustomEvent('foo', canBubble: false, cancelable: false,
+ test('custom events', () {
+ var provider = new EventStreamProvider<CustomEvent>('foo');
+ var el = new DivElement();
+
+ var fired = false;
+ provider.forTarget(el).listen((ev) {
+ fired = true;
+ expect(ev.detail, 'detail');
+ });
+
+ var ev = new CustomEvent('foo', canBubble: false, cancelable: false,
detail: 'detail');
- },
- (ev) { expect(ev.detail, equals('detail')); });
+ el.dispatchEvent(ev);
+ expect(fired, isTrue);
+ });
}

Powered by Google App Engine
This is Rietveld 408576698