| 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 @TestOn("vm") | 5 @TestOn("vm") |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 return new Future(() { | 141 return new Future(() { |
| 142 // Loop forever so that if the test isn't stopped while running, it never | 142 // Loop forever so that if the test isn't stopped while running, it never |
| 143 // stops. | 143 // stops. |
| 144 while (true) {} | 144 while (true) {} |
| 145 }); | 145 }); |
| 146 }); | 146 }); |
| 147 } | 147 } |
| 148 """); | 148 """); |
| 149 | 149 |
| 150 return _startTest(["-p", "content-shell", "test.dart"]).then((process) { | 150 return _startTest(["-p", "content-shell", "test.dart"]).then((process) { |
| 151 return _lines.bind(process.stdout).skip(3).first.then((line) { | 151 // The first line is blank, and the second is a status line from the |
| 152 // reporter. |
| 153 return _lines.bind(process.stdout).skip(2).first.then((line) { |
| 152 expect(line, equals("running test")); | 154 expect(line, equals("running test")); |
| 153 process.kill(); | 155 process.kill(); |
| 154 return process.exitCode; | 156 return process.exitCode; |
| 155 }).then((_) { | 157 }).then((_) { |
| 156 expect(new Directory(_tempDir).listSync(), isEmpty); | 158 expect(new Directory(_tempDir).listSync(), isEmpty); |
| 157 }); | 159 }); |
| 158 }); | 160 }); |
| 159 }); | 161 }); |
| 160 | 162 |
| 161 test("kills a VM test immediately if ^C is sent twice", () { | 163 test("kills a VM test immediately if ^C is sent twice", () { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 }); | 270 }); |
| 269 }); | 271 }); |
| 270 }); | 272 }); |
| 271 } | 273 } |
| 272 | 274 |
| 273 Future<Process> _startTest(List<String> args) { | 275 Future<Process> _startTest(List<String> args) { |
| 274 new Directory(_tempDir).create(); | 276 new Directory(_tempDir).create(); |
| 275 return startTest(args, workingDirectory: _sandbox, | 277 return startTest(args, workingDirectory: _sandbox, |
| 276 environment: {"_UNITTEST_TEMP_DIR": _tempDir}); | 278 environment: {"_UNITTEST_TEMP_DIR": _tempDir}); |
| 277 } | 279 } |
| OLD | NEW |