| 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 // Windows doesn't support sending signals. | 5 // Windows doesn't support sending signals. |
| 6 @TestOn("vm && !windows") | 6 @TestOn("vm && !windows") |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 227 |
| 228 tearDown(() { | 228 tearDown(() { |
| 229 new File("output").writeAsStringSync(expectAsyncThrewError.toString()); | 229 new File("output").writeAsStringSync(expectAsyncThrewError.toString()); |
| 230 }); | 230 }); |
| 231 | 231 |
| 232 test("test", () async { | 232 test("test", () async { |
| 233 print("running test"); | 233 print("running test"); |
| 234 | 234 |
| 235 await new Future.delayed(new Duration(seconds: 1)); | 235 await new Future.delayed(new Duration(seconds: 1)); |
| 236 try { | 236 try { |
| 237 expectAsync(() {}); | 237 expectAsync0(() {}); |
| 238 } catch (_) { | 238 } catch (_) { |
| 239 expectAsyncThrewError = true; | 239 expectAsyncThrewError = true; |
| 240 } | 240 } |
| 241 }); | 241 }); |
| 242 } | 242 } |
| 243 """).create(); | 243 """).create(); |
| 244 | 244 |
| 245 var test = _runTest(["test.dart"]); | 245 var test = _runTest(["test.dart"]); |
| 246 test.stdout.expect(consumeThrough("running test")); | 246 test.stdout.expect(consumeThrough("running test")); |
| 247 signalAndQuit(test); | 247 signalAndQuit(test); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 259 | 259 |
| 260 void signalAndQuit(ScheduledProcess test) { | 260 void signalAndQuit(ScheduledProcess test) { |
| 261 test.signal(ProcessSignal.SIGTERM); | 261 test.signal(ProcessSignal.SIGTERM); |
| 262 test.shouldExit(); | 262 test.shouldExit(); |
| 263 test.stderr.expect(isDone); | 263 test.stderr.expect(isDone); |
| 264 } | 264 } |
| 265 | 265 |
| 266 void expectTempDirEmpty() { | 266 void expectTempDirEmpty() { |
| 267 schedule(() => expect(new Directory(_tempDir).listSync(), isEmpty)); | 267 schedule(() => expect(new Directory(_tempDir).listSync(), isEmpty)); |
| 268 } | 268 } |
| OLD | NEW |