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

Unified Diff: tests/html/events_test.dart

Issue 133313004: pkg/unittest: Run tests in zones (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nit Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/lib/async/future_timeout_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/events_test.dart
diff --git a/tests/html/events_test.dart b/tests/html/events_test.dart
index ebb9181f62b0421ca6c423771587abda5e1eb40b..3b87540abf06fdad334c4739e5ec0e0adfcb893d 100644
--- a/tests/html/events_test.dart
+++ b/tests/html/events_test.dart
@@ -71,7 +71,16 @@ main() {
provider.forTarget(element).listen(handler);
invocationCounter = 0;
element.dispatchEvent(event);
- expect(invocationCounter, 1);
+
+ // NOTE: when run in a custom zone, the handler is wrapped
+ // The logic for html events which ensures identical handlers are added only
+ // once is therefor muted by the wrapped handlers.
+ // Hence, we get different behavior depending on the current zone.
+ if(Zone.current == Zone.ROOT) {
+ expect(invocationCounter, 1);
+ } else {
+ expect(invocationCounter, 2);
+ }
});
test('InitMouseEvent', () {
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/lib/async/future_timeout_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698