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

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

Issue 11827017: Update remaining usages of Completer.completeException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | tests/standalone/io/file_invalid_arguments_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 future_test; 5 library future_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 9
10 testImmediate() { 10 testImmediate() {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 var port = new ReceivePort(); 94 var port = new ReceivePort();
95 future 95 future
96 .then((v) { throw "Value not expected"; }) 96 .then((v) { throw "Value not expected"; })
97 .catchError((e) { 97 .catchError((e) {
98 Expect.equals(e.error, ex); 98 Expect.equals(e.error, ex);
99 port.close(); 99 port.close();
100 }, test: (e) => e == ex); 100 }, test: (e) => e == ex);
101 completer.completeError(ex); 101 completer.completeError(ex);
102 } 102 }
103 103
104 testExceptionNoSuccessListeners() {
105 final completer = new Completer<int>();
106 final future = completer.future;
107 final ex = new Exception();
108 completer.completeException(ex); // future.then is not called, so no exception
109 }
110
111 testExceptionHandler() { 104 testExceptionHandler() {
112 final completer = new Completer<int>(); 105 final completer = new Completer<int>();
113 final future = completer.future; 106 final future = completer.future;
114 final ex = new Exception(); 107 final ex = new Exception();
115 108
116 var ex2; 109 var ex2;
117 var done = future.catchError((e) { ex2 = e.error; }); 110 var done = future.catchError((e) { ex2 = e.error; });
118 completer.completeError(ex); 111 completer.completeError(ex);
119 112
120 var port = new ReceivePort(); 113 var port = new ReceivePort();
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 testFutureAsStreamCompleteImmediate(); 361 testFutureAsStreamCompleteImmediate();
369 testFutureAsStreamCompleteErrorAfter(); 362 testFutureAsStreamCompleteErrorAfter();
370 testFutureAsStreamWrapper(); 363 testFutureAsStreamWrapper();
371 364
372 testFutureWhenCompleteValue(); 365 testFutureWhenCompleteValue();
373 testFutureWhenCompleteError(); 366 testFutureWhenCompleteError();
374 testFutureWhenCompleteValueNewError(); 367 testFutureWhenCompleteValueNewError();
375 testFutureWhenCompleteErrorNewError(); 368 testFutureWhenCompleteErrorNewError();
376 } 369 }
377 370
OLDNEW
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | tests/standalone/io/file_invalid_arguments_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698