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 /// This package works by building up a queue of asynchronous tasks called a | 10 /// This package works by building up a queue of asynchronous tasks called a | 
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 /// inspect the state of the schedule. | 194 /// inspect the state of the schedule. | 
| 195 /// | 195 /// | 
| 196 /// This is `null` when there's no test currently running. | 196 /// This is `null` when there's no test currently running. | 
| 197 Schedule get currentSchedule => _currentSchedule; | 197 Schedule get currentSchedule => _currentSchedule; | 
| 198 Schedule _currentSchedule; | 198 Schedule _currentSchedule; | 
| 199 | 199 | 
| 200 /// The user-provided setUp function. This is set for each test during | 200 /// The user-provided setUp function. This is set for each test during | 
| 201 /// `unittest.setUp`. | 201 /// `unittest.setUp`. | 
| 202 Function _setUpFn; | 202 Function _setUpFn; | 
| 203 | 203 | 
| 204 /// If `true`, then new [Task]s will capture the current stack trace before | |
| 205 /// running. This can be set to `false` to speed up running tests since | |
| 206 /// capturing stack traces is currently quite slow. Even when set to `false`, | |
| 207 /// stack traces from *thrown* exceptions will be caught. This only disables | |
| 208 /// the eager collection of stack traces *before* an error occurs. Defaults to | |
| 209 /// `true`. | |
| 210 bool captureStackTraces = true; | |
| 
 
nweiz
2013/04/09 21:25:58
I'd rather see this on the Schedule class. That's
 
Bob Nystrom
2013/04/10 21:52:00
Done.
 
 | |
| 211 | |
| 204 /// Creates a new test case with the given description and body. This has the | 212 /// Creates a new test case with the given description and body. This has the | 
| 205 /// same semantics as [unittest.test]. | 213 /// same semantics as [unittest.test]. | 
| 206 void test(String description, void body()) => | 214 void test(String description, void body()) => | 
| 207 _test(description, body, unittest.test); | 215 _test(description, body, unittest.test); | 
| 208 | 216 | 
| 209 /// Creates a new test case with the given description and body that will be the | 217 /// Creates a new test case with the given description and body that will be the | 
| 210 /// only test run in this file. This has the same semantics as | 218 /// only test run in this file. This has the same semantics as | 
| 211 /// [unittest.solo_test]. | 219 /// [unittest.solo_test]. | 
| 212 void solo_test(String description, void body()) => | 220 void solo_test(String description, void body()) => | 
| 213 _test(description, body, unittest.solo_test); | 221 _test(description, body, unittest.solo_test); | 
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 | 352 | 
| 345 return currentSchedule.wrapFuture(future, description); | 353 return currentSchedule.wrapFuture(future, description); | 
| 346 } | 354 } | 
| 347 | 355 | 
| 348 // TODO(nweiz): re-export these once issue 9535 is fixed. | 356 // TODO(nweiz): re-export these once issue 9535 is fixed. | 
| 349 unittest.Configuration get unittestConfiguration => | 357 unittest.Configuration get unittestConfiguration => | 
| 350 unittest.unittestConfiguration; | 358 unittest.unittestConfiguration; | 
| 351 void set unittestConfiguration(unittest.Configuration value) { | 359 void set unittestConfiguration(unittest.Configuration value) { | 
| 352 unittest.unittestConfiguration = value; | 360 unittest.unittestConfiguration = value; | 
| 353 } | 361 } | 
| OLD | NEW |