Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // TODO(nweiz): Add support for calling [schedule] while the schedule is already | 5 // TODO(nweiz): Add support for calling [schedule] while the schedule is already |
| 6 // running. | 6 // running. |
| 7 // TODO(nweiz): Port the non-Pub-specific scheduled test libraries from Pub. | 7 // TODO(nweiz): Port the non-Pub-specific scheduled test libraries from Pub. |
| 8 /// A package for writing readable tests of asynchronous behavior. | 8 /// A package for writing readable tests of asynchronous behavior. |
| 9 /// | 9 /// |
| 10 /// ## Installing ## | 10 /// ## Installing ## |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 307 if (_inGroup || _setUpForTopLevel) return; | 307 if (_inGroup || _setUpForTopLevel) return; |
| 308 _setUpScheduledTest(); | 308 _setUpScheduledTest(); |
| 309 } | 309 } |
| 310 | 310 |
| 311 /// Registers callbacks for [unittest.setUp] and [unittest.tearDown] that set up | 311 /// Registers callbacks for [unittest.setUp] and [unittest.tearDown] that set up |
| 312 /// and tear down the scheduled test infrastructure. | 312 /// and tear down the scheduled test infrastructure. |
| 313 void _setUpScheduledTest([void setUpFn()]) { | 313 void _setUpScheduledTest([void setUpFn()]) { |
| 314 if (!_inGroup) _setUpForTopLevel = true; | 314 if (!_inGroup) _setUpForTopLevel = true; |
| 315 | 315 |
| 316 unittest.setUp(() { | 316 unittest.setUp(() { |
| 317 if (currentSchedule != null) { | 317 if (currentSchedule == null) { |
| 318 throw new StateError('There seems to be another scheduled test ' | 318 _currentSchedule = new Schedule(); |
| 319 'still running.'); | |
|
nweiz
2013/04/23 00:04:53
Why is this being removed? This is important, sinc
gram
2013/04/23 00:07:05
Because it is completely broken with the chaining
nweiz
2013/04/23 00:20:52
We should fix that, then, rather than just removin
gram
2013/04/23 19:42:47
Done.
| |
| 320 } | 319 } |
| 321 _currentSchedule = new Schedule(); | |
| 322 _setUpFn = setUpFn; | 320 _setUpFn = setUpFn; |
| 323 }); | 321 }); |
| 324 | 322 |
| 325 unittest.tearDown(() { | 323 unittest.tearDown(() { |
| 326 _currentSchedule = null; | 324 _currentSchedule = null; |
| 327 }); | 325 }); |
| 328 } | 326 } |
| 329 | 327 |
| 330 /// Ensures that the global configuration for `scheduled_test` has been | 328 /// Ensures that the global configuration for `scheduled_test` has been |
| 331 /// initialized. | 329 /// initialized. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 358 | 356 |
| 359 return currentSchedule.wrapFuture(future, description); | 357 return currentSchedule.wrapFuture(future, description); |
| 360 } | 358 } |
| 361 | 359 |
| 362 // TODO(nweiz): re-export these once issue 9535 is fixed. | 360 // TODO(nweiz): re-export these once issue 9535 is fixed. |
| 363 unittest.Configuration get unittestConfiguration => | 361 unittest.Configuration get unittestConfiguration => |
| 364 unittest.unittestConfiguration; | 362 unittest.unittestConfiguration; |
| 365 void set unittestConfiguration(unittest.Configuration value) { | 363 void set unittestConfiguration(unittest.Configuration value) { |
| 366 unittest.unittestConfiguration = value; | 364 unittest.unittestConfiguration = value; |
| 367 } | 365 } |
| OLD | NEW |