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

Unified Diff: tests/html/async_window_test.dart

Issue 12086068: Attempting to de-flake async_window test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/async_window_test.dart
diff --git a/tests/html/async_window_test.dart b/tests/html/async_window_test.dart
index 59b3deee6dab439cbe9d18c60f9e40d0dbba92b0..1e5544857711c8a23101abe826e361a13170082a 100644
--- a/tests/html/async_window_test.dart
+++ b/tests/html/async_window_test.dart
@@ -11,18 +11,20 @@ main() {
test('Window.setInterval', () {
int counter = 0;
int id = null;
- id = window.setInterval(expectAsync0(() {
- if (counter == 3) {
- counter = 1024;
- window.clearInterval(id);
- // Wait some more time to be sure callback won't be invoked any more.
- window.setTimeout(expectAsync0((){}), 50);
- return;
- }
- // As callback should have been cleared on 4th invocation, counter
- // should never be greater than 3.
- assert(counter < 3);
- counter++;
- }, 3), 10);
+ id = window.setInterval(expectAsyncUntil0(
+ () {
+ if (counter == 3) {
+ counter = 1024;
+ window.clearInterval(id);
+ // Wait some more time to be sure callback won't be invoked any more.
+ window.setTimeout(expectAsync0((){}), 50);
+ return;
+ }
+ // As callback should have been cleared on 4th invocation, counter
+ // should never be greater than 3.
+ assert(counter < 3);
+ counter++;
+ },
+ () => counter == 3), 10);
});
}
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698