Chromium Code Reviews| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 var line = await lineSplitter.bind(process.stdout).skip(1).first; | 79 var line = await lineSplitter.bind(process.stdout).skip(1).first; |
| 80 expect(line, equals("in test.dart")); | 80 expect(line, equals("in test.dart")); |
| 81 process.kill(); | 81 process.kill(); |
| 82 | 82 |
| 83 // TODO(nweiz): Sending two signals in close succession can cause the | 83 // TODO(nweiz): Sending two signals in close succession can cause the |
| 84 // second one to be ignored, so we wait a bit before the second | 84 // second one to be ignored, so we wait a bit before the second |
| 85 // one. Remove this hack when issue 23047 is fixed. | 85 // one. Remove this hack when issue 23047 is fixed. |
| 86 await new Future.delayed(new Duration(seconds: 1)); | 86 await new Future.delayed(new Duration(seconds: 1)); |
| 87 process.kill(); | 87 process.kill(); |
| 88 await process.exitCode; | 88 await process.exitCode; |
| 89 expect(new Directory(_tempDir).listSync(), isEmpty); | |
|
kevmoo
2015/06/25 03:18:31
Why this change?
nweiz
2015/06/25 20:42:31
We shouldn't have been testing this in the first p
| |
| 90 }); | 89 }); |
| 91 }); | 90 }); |
| 92 | 91 |
| 93 group("during test running", () { | 92 group("during test running", () { |
| 94 test("waits for a VM test to finish running", () async { | 93 test("waits for a VM test to finish running", () async { |
| 95 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" | 94 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" |
| 96 import 'dart:async'; | 95 import 'dart:async'; |
| 97 import 'dart:io'; | 96 import 'dart:io'; |
| 98 | 97 |
| 99 import 'package:test/test.dart'; | 98 import 'package:test/test.dart'; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 expect(new Directory(_tempDir).listSync(), isEmpty); | 255 expect(new Directory(_tempDir).listSync(), isEmpty); |
| 257 }); | 256 }); |
| 258 }); | 257 }); |
| 259 } | 258 } |
| 260 | 259 |
| 261 Future<Process> _startTest(List<String> args) { | 260 Future<Process> _startTest(List<String> args) { |
| 262 new Directory(_tempDir).create(); | 261 new Directory(_tempDir).create(); |
| 263 return startTest(args, workingDirectory: _sandbox, | 262 return startTest(args, workingDirectory: _sandbox, |
| 264 environment: {"_UNITTEST_TEMP_DIR": _tempDir}); | 263 environment: {"_UNITTEST_TEMP_DIR": _tempDir}); |
| 265 } | 264 } |
| OLD | NEW |