| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import "dart:async"; | 5 import "dart:async"; |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
| 8 | 8 |
| 9 class Tracer { | 9 class Tracer { |
| 10 final String expected; | 10 final String expected; |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 } finally { | 432 } finally { |
| 433 await new Future.value(3); /// forceAwait: continued | 433 await new Future.value(3); /// forceAwait: continued |
| 434 tracer.trace("c"); | 434 tracer.trace("c"); |
| 435 } | 435 } |
| 436 tracer.trace("d"); | 436 tracer.trace("d"); |
| 437 } | 437 } |
| 438 tracer.trace("e"); | 438 tracer.trace("e"); |
| 439 } | 439 } |
| 440 | 440 |
| 441 runTest(expectedTrace, fun, [expectedError]) async { | 441 runTest(expectedTrace, fun, [expectedError]) async { |
| 442 Tracer tracer = new Tracer(expectedTrace); | 442 Tracer tracer = new Tracer(expectedTrace, expectedTrace); |
| 443 try { | 443 try { |
| 444 await fun(tracer); | 444 await fun(tracer); |
| 445 } catch (error) { | 445 } catch (error) { |
| 446 Expect.equals(expectedError, error); | 446 Expect.equals(expectedError, error); |
| 447 tracer.trace("X"); | 447 tracer.trace("X"); |
| 448 } | 448 } |
| 449 tracer.done(); | 449 tracer.done(); |
| 450 } | 450 } |
| 451 | 451 |
| 452 test() async { | 452 test() async { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 467 await runTest("abcdefgX", foo14, "Error3"); | 467 await runTest("abcdefgX", foo14, "Error3"); |
| 468 await runTest("abcdefg", foo15); | 468 await runTest("abcdefg", foo15); |
| 469 await runTest("abcdfg", foo16); | 469 await runTest("abcdfg", foo16); |
| 470 await runTest("abcdef", foo17); | 470 await runTest("abcdef", foo17); |
| 471 await runTest("abcde", foo18); | 471 await runTest("abcde", foo18); |
| 472 } | 472 } |
| 473 | 473 |
| 474 void main() { | 474 void main() { |
| 475 asyncTest(test); | 475 asyncTest(test); |
| 476 } | 476 } |
| OLD | NEW |