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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Allow an event loop to pass so the preceding print can be handled. | 140 // Allow an event loop to pass so the preceding print can be handled. |
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", "chrome", "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 return _lines.bind(process.stdout).skip(3).first.then((line) { |
152 expect(line, equals("running test")); | 152 expect(line, equals("running test")); |
153 process.kill(); | 153 process.kill(); |
154 return process.exitCode; | 154 return process.exitCode; |
155 }).then((_) { | 155 }).then((_) { |
156 expect(new Directory(_tempDir).listSync(), isEmpty); | 156 expect(new Directory(_tempDir).listSync(), isEmpty); |
157 }); | 157 }); |
158 }); | 158 }); |
159 }); | 159 }); |
160 | 160 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 }); | 268 }); |
269 }); | 269 }); |
270 }); | 270 }); |
271 } | 271 } |
272 | 272 |
273 Future<Process> _startTest(List<String> args) { | 273 Future<Process> _startTest(List<String> args) { |
274 new Directory(_tempDir).create(); | 274 new Directory(_tempDir).create(); |
275 return startTest(args, workingDirectory: _sandbox, | 275 return startTest(args, workingDirectory: _sandbox, |
276 environment: {"_UNITTEST_TEMP_DIR": _tempDir}); | 276 environment: {"_UNITTEST_TEMP_DIR": _tempDir}); |
277 } | 277 } |
OLD | NEW |