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

Unified Diff: tests/html/events_test.dart

Issue 11275054: Modified unittest to use new argument syntax. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
Index: tests/html/events_test.dart
===================================================================
--- tests/html/events_test.dart (revision 14156)
+++ tests/html/events_test.dart (working copy)
@@ -9,7 +9,7 @@
Event event = new Event('test');
int timeStamp = event.timeStamp;
- Expect.isTrue(timeStamp > 0);
+ expect(timeStamp, greaterThan(0));
});
// The next test is not asynchronous because [on['test'].dispatch(event)] fires the event
// and event listener synchronously.
@@ -20,9 +20,9 @@
int invocationCounter = 0;
void handler(Event e) {
- Expect.equals('test', e.type);
+ expect(e.type, equals('test'));
Element target = e.target;
- Expect.identical(element, target);
+ expect(element, equals(target));
invocationCounter++;
}
@@ -30,27 +30,27 @@
invocationCounter = 0;
element.on['test'].dispatch(event);
- Expect.equals(0, invocationCounter);
+ expect(invocationCounter, isZero);
element.on['test'].add(handler, false);
invocationCounter = 0;
element.on['test'].dispatch(event);
- Expect.equals(1, invocationCounter);
+ expect(invocationCounter, 1);
element.on['test'].remove(handler, false);
invocationCounter = 0;
element.on['test'].dispatch(event);
- Expect.equals(0, invocationCounter);
+ expect(invocationCounter, isZero);
element.on['test'].add(handler, false);
invocationCounter = 0;
element.on['test'].dispatch(event);
- Expect.equals(1, invocationCounter);
+ expect(invocationCounter, 1);
element.on['test'].add(handler, false);
invocationCounter = 0;
element.on['test'].dispatch(event);
- Expect.equals(1, invocationCounter);
+ expect(invocationCounter, 1);
});
test('InitMouseEvent', () {
DivElement div = new Element.tag('div');

Powered by Google App Engine
This is Rietveld 408576698