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

Side by Side Diff: test/utils.dart

Issue 1610443002: Add StreamChannel and MultiChannel. (Closed) Base URL: git@github.com:dart-lang/stream_channel.git@master
Patch Set: Code review changes Created 4 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 unified diff | Download patch
« no previous file with comments | « test/multi_channel_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:async';
6
7 /// Returns a [Future] that completes after pumping the event queue [times]
8 /// times.
9 ///
10 /// By default, this should pump the event queue enough times to allow any code
11 /// to run, as long as it's not waiting on some external event.
12 Future pumpEventQueue([int times=20]) {
13 if (times == 0) return new Future.value();
14 // Use [new Future] future to allow microtask events to finish. The [new
15 // Future.value] constructor uses scheduleMicrotask itself and would therefore
16 // not wait for microtask callbacks that are scheduled after invoking this
17 // method.
18 return new Future(() => pumpEventQueue(times - 1));
19 }
20
OLDNEW
« no previous file with comments | « test/multi_channel_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698