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

Unified Diff: pkg/unittest/test/test_utils.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 | « pkg/unittest/lib/unittest.dart ('k') | runtime/lib/timer_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test/test_utils.dart
diff --git a/pkg/unittest/test/test_utils.dart b/pkg/unittest/test/test_utils.dart
index 4a7e1ae13e5746c983084741028da7620c296cb6..17e88486fcaece76ca82795fe8e8dc73a82447d9 100644
--- a/pkg/unittest/test/test_utils.dart
+++ b/pkg/unittest/test/test_utils.dart
@@ -26,7 +26,7 @@ void shouldFail(value, Matcher matcher, expected, {bool isAsync: false}) {
errorCount = 0;
errorString = '';
expect(value, matcher);
- afterTest(_) {
+ afterTest() {
configureExpectFailureHandler(null);
expect(errorCount, equals(1));
if (expected is String) {
@@ -37,9 +37,9 @@ void shouldFail(value, Matcher matcher, expected, {bool isAsync: false}) {
}
if (isAsync) {
- new Timer(0, expectAsync1(afterTest));
+ Timer.run(expectAsync0(afterTest));
} else {
- afterTest(null);
+ afterTest();
}
}
@@ -48,13 +48,13 @@ void shouldPass(value, Matcher matcher, {bool isAsync: false}) {
errorCount = 0;
errorString = '';
expect(value, matcher);
- afterTest(_) {
+ afterTest() {
configureExpectFailureHandler(null);
expect(errorCount, equals(0));
}
if (isAsync) {
- new Timer(0, expectAsync1(afterTest));
+ Timer.run(expectAsync0(afterTest));
} else {
- afterTest(null);
+ afterTest();
}
}
« no previous file with comments | « pkg/unittest/lib/unittest.dart ('k') | runtime/lib/timer_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698