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

Unified Diff: client/tests/client/html/EventTests.dart

Issue 8907024: Fix the event tests under Frog. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tests/client/html/EventTests.dart
diff --git a/client/tests/client/html/EventTests.dart b/client/tests/client/html/EventTests.dart
index 92f01ed6ce56075100d2d57c599c424d85f1f783..30787587f871c86fb7e4f4780ee40b42066ebc44 100644
--- a/client/tests/client/html/EventTests.dart
+++ b/client/tests/client/html/EventTests.dart
@@ -2,21 +2,23 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-testEvents() {
- eventTest(String name, Event eventFn(), void validate(Event),
- [String type = 'foo']) {
- test(name, () {
- final el = new Element.tag('div');
- var fired = false;
- el.on[type].add((ev) {
- fired = true;
- validate(ev);
- });
- el.on[type].dispatch(eventFn());
- Expect.isTrue(fired, 'Expected event to be dispatched.');
+// TODO(nweiz): Make this private to testEvents when Frog supports closures with
+// optional arguments.
+eventTest(String name, Event eventFn(), void validate(Event),
+ [String type = 'foo']) {
+ test(name, () {
+ final el = new Element.tag('div');
+ var fired = false;
+ el.on[type].add((ev) {
+ fired = true;
+ validate(ev);
});
- }
+ el.on[type].dispatch(eventFn());
+ Expect.isTrue(fired, 'Expected event to be dispatched.');
+ });
+}
+testEvents() {
eventTest('AnimationEvent', () => new AnimationEvent('foo', 'color', 0.5),
(ev) {
Expect.equals('color', ev.animationName);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698