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

Unified Diff: tests/lib/async/stream_controller_async_test.dart

Issue 27499002: Fix flaky stream_controller_async_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reword comment. Created 7 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
« no previous file with comments | « tests/lib/async/event_helper.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/stream_controller_async_test.dart
diff --git a/tests/lib/async/stream_controller_async_test.dart b/tests/lib/async/stream_controller_async_test.dart
index ecc647481b64b7939571cda8f06f9afdee317de5..22226ddacada0b9c9c82fffbf44b743197e3b61d 100644
--- a/tests/lib/async/stream_controller_async_test.dart
+++ b/tests/lib/async/stream_controller_async_test.dart
@@ -663,16 +663,9 @@ void testSink({bool sync, bool broadcast, bool asBroadcast}) {
// The done-future of the sink completes when it passes
// the done event to the asBroadcastStream controller, which is
// before the final listener gets the event.
- // Wait for the pause to end before testing the events.
- dynamic executeWhenPauseIsDone(Function f) {
- if (!pauseIsDone) {
- return new Future.delayed(const Duration(milliseconds: 50), () {
- return executeWhenPauseIsDone(f);
- });
- }
- return f();
- }
- return executeWhenPauseIsDone(() {
+ // Wait for the done event to be *delivered* before testing the
+ // events.
+ actual.onDone(() {
Expect.listEquals(expected.events, actual.events);
done();
});
« no previous file with comments | « tests/lib/async/event_helper.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698