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

Unified Diff: lib/src/utils.dart

Issue 1561073003: Support re-running tests while debugging. (Closed) Base URL: git@github.com:dart-lang/test@debugger-wip
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/runner/reporter/compact.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 5f970dea83c48d48e708563dcff8827df498186d..cab8077df8fb9c20030cacab952ae37c3f7abbe3 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -352,12 +352,17 @@ Future maybeFirst(Stream stream) {
/// either completed or been canceled.
CancelableOperation cancelableNext(StreamQueue queue) {
var fork = queue.fork();
- var completer = new CancelableCompleter(
- onCancel: () => fork.cancel(immediate: true));
+ var canceled = false;
+ var completer = new CancelableCompleter(onCancel: () {
+ canceled = true;
+ return fork.cancel(immediate: true);
+ });
+
completer.complete(fork.next.then((_) {
fork.cancel();
- return queue.next;
+ return canceled ? null : queue.next;
}));
+
return completer.operation;
}
« no previous file with comments | « lib/src/runner/reporter/compact.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698