| 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 library async_await_test; | 5 library async_await_test; |
| 6 | 6 |
| 7 import "package:unittest/unittest.dart"; | 7 import "package:unittest/unittest.dart"; |
| 8 import "dart:async"; | 8 import "dart:async"; |
| 9 | 9 |
| 10 main() { | 10 main() { |
| (...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1719 }); | 1719 }); |
| 1720 | 1720 |
| 1721 test("top-level getter call", () { | 1721 test("top-level getter call", () { |
| 1722 f() async { | 1722 f() async { |
| 1723 var a = new Async(); | 1723 var a = new Async(); |
| 1724 return await a.instanceGetter; | 1724 return await a.instanceGetter; |
| 1725 } | 1725 } |
| 1726 return expect42(f()); | 1726 return expect42(f()); |
| 1727 }); | 1727 }); |
| 1728 | 1728 |
| 1729 if (!checkedMode) return; |
| 1730 |
| 1729 test("inside assert, true", () { /// 03: ok | 1731 test("inside assert, true", () { /// 03: ok |
| 1730 f() async { /// 03: continued | 1732 f() async { /// 03: continued |
| 1731 assert(await new Future.microtask(() => true)); /// 03: continued | 1733 assert(await new Future.microtask(() => true)); /// 03: continued |
| 1732 return 42; /// 03: continued | 1734 return 42; /// 03: continued |
| 1733 } /// 03: continued | 1735 } /// 03: continued |
| 1734 return expect42(f()); /// 03: continued | 1736 return expect42(f()); /// 03: continued |
| 1735 }); /// 03: continued | 1737 }); /// 03: continued |
| 1736 | 1738 |
| 1737 test("inside assert, false", () { /// 03: continued | 1739 test("inside assert, false", () { /// 03: continued |
| 1738 f() async { /// 03: continued | 1740 f() async { /// 03: continued |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1997 if (onError is BinaryFunction) { | 1999 if (onError is BinaryFunction) { |
| 1998 return onError(_error, null); | 2000 return onError(_error, null); |
| 1999 } | 2001 } |
| 2000 return onError(_error); | 2002 return onError(_error); |
| 2001 }); | 2003 }); |
| 2002 } | 2004 } |
| 2003 Stream asStream() => | 2005 Stream asStream() => |
| 2004 (new StreamController()..addError(_error)..close()).stream; | 2006 (new StreamController()..addError(_error)..close()).stream; |
| 2005 Future timeout(Duration duration, {onTimeout}) => this; | 2007 Future timeout(Duration duration, {onTimeout}) => this; |
| 2006 } | 2008 } |
| OLD | NEW |