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

Unified Diff: tests/html/element_test.dart

Issue 26135004: Adding ElementEventStream.capture (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/EventStreamProvider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/element_test.dart
diff --git a/tests/html/element_test.dart b/tests/html/element_test.dart
index 06b1e41ef05f06b238d1639003f92e53f1fd46db..d07c50aadd1002b4f301e37ef62f79f44370f414 100644
--- a/tests/html/element_test.dart
+++ b/tests/html/element_test.dart
@@ -849,6 +849,43 @@ main() {
query('.i').click();
expect(firedEvent5, true);
});
+
+ test('event ordering', () {
+ var a = new DivElement();
+ var b = new DivElement();
+ a.append(b);
+ var c = new DivElement();
+ b.append(c);
+
+ var eventOrder = [];
+
+ a.on['custom_event'].listen((_) {
+ eventOrder.add('a no-capture');
+ });
+
+ a.on['custom_event'].capture((_) {
+ eventOrder.add('a capture');
+ });
+
+ b.on['custom_event'].listen((_) {
+ eventOrder.add('b no-capture');
+ });
+
+ b.on['custom_event'].capture((_) {
+ eventOrder.add('b capture');
+ });
+
+ document.body.append(a);
+
+ var event = new Event('custom_event', canBubble: true);
+ c.dispatchEvent(event);
+ expect(eventOrder, [
+ 'a capture',
+ 'b capture',
+ 'b no-capture',
+ 'a no-capture'
+ ]);
+ });
});
group('ElementList', () {
« 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