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

Side by Side Diff: tests/corelib/future_test.dart

Issue 10891020: Update almost all tests (except co19) to use the new try-catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 years, 3 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
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 // Tests for Future.immediate 5 // Tests for Future.immediate
6 6
7 testImmediate() { 7 testImmediate() {
8 final future = new Future<String>.immediate("42"); 8 final future = new Future<String>.immediate("42");
9 Expect.isTrue(future.isComplete); 9 Expect.isTrue(future.isComplete);
10 Expect.isTrue(future.hasValue); 10 Expect.isTrue(future.hasValue);
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 Expect.throws(() { future.then((e) { }); }); 302 Expect.throws(() { future.then((e) { }); });
303 Expect.equals(ex, ex2); 303 Expect.equals(ex, ex2);
304 } 304 }
305 305
306 // Tests for accessing the exception call stack. 306 // Tests for accessing the exception call stack.
307 307
308 testCallStackThrowsIfNotComplete() { 308 testCallStackThrowsIfNotComplete() {
309 var exception; 309 var exception;
310 try { 310 try {
311 new Completer().future.stackTrace; 311 new Completer().future.stackTrace;
312 } catch (var ex) { 312 } catch (ex) {
313 exception = ex; 313 exception = ex;
314 } 314 }
315 315
316 Expect.isTrue(exception is FutureNotCompleteException); 316 Expect.isTrue(exception is FutureNotCompleteException);
317 } 317 }
318 318
319 testCallStackIsNullIfCompletedSuccessfully() { 319 testCallStackIsNullIfCompletedSuccessfully() {
320 Expect.isNull(new Future.immediate('blah').stackTrace); 320 Expect.isNull(new Future.immediate('blah').stackTrace);
321 } 321 }
322 322
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 testExceptionWithCompletionAndSuccessHandlers(); 527 testExceptionWithCompletionAndSuccessHandlers();
528 testExceptionWithCompletionAndSuccessAndExceptionHandlers(); 528 testExceptionWithCompletionAndSuccessAndExceptionHandlers();
529 testTransformSuccess(); 529 testTransformSuccess();
530 testTransformFutureFails(); 530 testTransformFutureFails();
531 testTransformTransformerFails(); 531 testTransformTransformerFails();
532 testChainSuccess(); 532 testChainSuccess();
533 testChainFirstFutureFails(); 533 testChainFirstFutureFails();
534 testChainTransformerFails(); 534 testChainTransformerFails();
535 testChainSecondFutureFails(); 535 testChainSecondFutureFails();
536 } 536 }
OLDNEW
« no previous file with comments | « tests/corelib/exception_implementation_test.dart ('k') | tests/corelib/growable_object_array2_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698