| 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 test.frontend.expect_async; | |
| 6 | |
| 7 import 'dart:async'; | 5 import 'dart:async'; |
| 8 | 6 |
| 9 import '../backend/invoker.dart'; | 7 import '../backend/invoker.dart'; |
| 10 import '../backend/state.dart'; | 8 import '../backend/state.dart'; |
| 11 import 'expect.dart'; | 9 import 'expect.dart'; |
| 12 | 10 |
| 13 /// An object used to detect unpassed arguments. | 11 /// An object used to detect unpassed arguments. |
| 14 const _PLACEHOLDER = const Object(); | 12 const _PLACEHOLDER = const Object(); |
| 15 | 13 |
| 16 // Functions used to check how many arguments a callback takes. | 14 // Functions used to check how many arguments a callback takes. |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 Function expectAsyncUntil(Function callback, bool isDone(), | 241 Function expectAsyncUntil(Function callback, bool isDone(), |
| 244 {String id, String reason}) { | 242 {String id, String reason}) { |
| 245 if (Invoker.current == null) { | 243 if (Invoker.current == null) { |
| 246 throw new StateError( | 244 throw new StateError( |
| 247 "expectAsyncUntil() may only be called within a test."); | 245 "expectAsyncUntil() may only be called within a test."); |
| 248 } | 246 } |
| 249 | 247 |
| 250 return new _ExpectedFunction(callback, 0, -1, | 248 return new _ExpectedFunction(callback, 0, -1, |
| 251 id: id, reason: reason, isDone: isDone).func; | 249 id: id, reason: reason, isDone: isDone).func; |
| 252 } | 250 } |
| OLD | NEW |