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

Unified Diff: pkg/unittest/lib/unittest.dart

Issue 12213092: Rework Timer interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 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 | « no previous file | pkg/unittest/test/test_utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/unittest.dart
diff --git a/pkg/unittest/lib/unittest.dart b/pkg/unittest/lib/unittest.dart
index 0bd231d00d81e67fb3849f105617a4f359076f30..1f751fd81e7f1a51850a36a1b7cc2fe706fc635f 100644
--- a/pkg/unittest/lib/unittest.dart
+++ b/pkg/unittest/lib/unittest.dart
@@ -90,19 +90,19 @@
* test('callback is executed once', () {
* // wrap the callback of an asynchronous call with [expectAsync0] if
* // the callback takes 0 arguments...
- * var timer = new Timer(0, (_) => expectAsync0(() {
+ * var timer = Timer.run(expectAsync0(() {
* int x = 2 + 3;
* expect(x, equals(5));
* }));
* });
*
* test('callback is executed twice', () {
- * var callback = (_) => expectAsync0(() {
+ * var callback = expectAsync0(() {
* int x = 2 + 3;
* expect(x, equals(5));
* }, count: 2); // <-- we can indicate multiplicity to [expectAsync0]
- * new Timer(0, callback);
- * new Timer(0, callback);
+ * Timer.run(callback);
+ * Timer.run(callback);
* });
* }
*
@@ -131,7 +131,7 @@
* test('callback is executed', () {
* // indicate ahead of time that an async callback is expected.
* var async = startAsync();
- * new Timer(0, (_) {
+ * Timer.run(() {
* // Guard the body of the callback, so errors are propagated
* // correctly.
* guardAsync(() {
« no previous file with comments | « no previous file | pkg/unittest/test/test_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698