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

Side by Side Diff: tests/lib/async/event_helper.dart

Issue 54723007: Fix warnings in library-tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/lib/async/future_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library event_helper; 5 library event_helper;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 abstract class Event { 9 abstract class Event {
10 void replay(EventSink sink); 10 void replay(EventSink sink);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 151
152 CaptureEvents(Stream stream, 152 CaptureEvents(Stream stream,
153 { bool cancelOnError: false }) { 153 { bool cancelOnError: false }) {
154 this.cancelOnError = cancelOnError; 154 this.cancelOnError = cancelOnError;
155 subscription = stream.listen(add, 155 subscription = stream.listen(add,
156 onError: addError, 156 onError: addError,
157 onDone: close, 157 onDone: close,
158 cancelOnError: cancelOnError); 158 cancelOnError: cancelOnError);
159 } 159 }
160 160
161 void addError(error) { 161 void addError(error, [stackTrace]) {
162 super.addError(error); 162 super.addError(error, stackTrace);
163 if (cancelOnError) { 163 if (cancelOnError) {
164 onDoneSignal.complete(); 164 onDoneSignal.complete();
165 } 165 }
166 } 166 }
167 167
168 void pause([Future resumeSignal]) { 168 void pause([Future resumeSignal]) {
169 if (trace) print("Events#$hashCode: pause"); 169 if (trace) print("Events#$hashCode: pause");
170 subscription.pause(resumeSignal); 170 subscription.pause(resumeSignal);
171 } 171 }
172 172
173 void resume() { 173 void resume() {
174 if (trace) print("Events#$hashCode: resume"); 174 if (trace) print("Events#$hashCode: resume");
175 subscription.resume(); 175 subscription.resume();
176 } 176 }
177 177
178 void onDone(void action()) { 178 void onDone(void action()) {
179 if (trace) print("Events#$hashCode: onDone"); 179 if (trace) print("Events#$hashCode: onDone");
180 super.onDone(action); 180 super.onDone(action);
181 } 181 }
182 } 182 }
OLDNEW
« no previous file with comments | « no previous file | tests/lib/async/future_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698