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 library scheduled_process_test; | 5 library scheduled_process_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:pathos/path.dart' as path; | 10 import 'package:pathos/path.dart' as path; |
11 import 'package:scheduled_test/scheduled_process.dart'; | 11 import 'package:scheduled_test/scheduled_process.dart'; |
12 import 'package:scheduled_test/scheduled_test.dart'; | 12 import 'package:scheduled_test/scheduled_test.dart'; |
13 import 'package:scheduled_test/src/mock_clock.dart' as mock_clock; | 13 import 'package:scheduled_test/src/mock_clock.dart' as mock_clock; |
14 | 14 |
15 import 'metatest.dart'; | 15 import 'metatest.dart'; |
16 import 'utils.dart'; | 16 import 'utils.dart'; |
17 | 17 |
18 void main() { | 18 void main() { |
19 metaSetUp(() { | 19 setUpTimeout(); |
20 // TODO(nweiz): We used to only increase the timeout to 10s for the Windows | |
21 // bots, but the Linux and Mac bots have started taking upwards of 5s when | |
22 // running pumpEventQueue, so we're increasing the timeout across the board | |
23 // (see issue 9248). | |
24 currentSchedule.timeout = new Duration(seconds: 10); | |
25 }); | |
26 | 20 |
27 expectTestsPass("a process must have kill() or shouldExit() called", () { | 21 expectTestsPass("a process must have kill() or shouldExit() called", () { |
28 var errors; | 22 var errors; |
29 test('test 1', () { | 23 test('test 1', () { |
30 currentSchedule.onException.schedule(() { | 24 currentSchedule.onException.schedule(() { |
31 errors = currentSchedule.errors; | 25 errors = currentSchedule.errors; |
32 }); | 26 }); |
33 | 27 |
34 startDartProcess('print("hello!");'); | 28 startDartProcess('print("hello!");'); |
35 }); | 29 }); |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 384 |
391 currentSchedule.onComplete.schedule(() { | 385 currentSchedule.onComplete.schedule(() { |
392 return tempDir.catchError((_) => null).then((dir) { | 386 return tempDir.catchError((_) => null).then((dir) { |
393 if (dir == null) return; | 387 if (dir == null) return; |
394 return new Directory(dir).delete(recursive: true); | 388 return new Directory(dir).delete(recursive: true); |
395 }); | 389 }); |
396 }, 'clean up temp dir'); | 390 }, 'clean up temp dir'); |
397 | 391 |
398 return new ScheduledProcess.start(dartExecutable, ['--checked', dartPath]); | 392 return new ScheduledProcess.start(dartExecutable, ['--checked', dartPath]); |
399 } | 393 } |
OLD | NEW |