OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:async/async.dart'; | 9 import 'package:async/async.dart'; |
10 import 'package:http_multi_server/http_multi_server.dart'; | 10 import 'package:http_multi_server/http_multi_server.dart'; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 return suite; | 264 return suite; |
265 } | 265 } |
266 | 266 |
267 /// Returns whether the test at [path] has precompiled JS available underneath | 267 /// Returns whether the test at [path] has precompiled JS available underneath |
268 /// `_config.precompiledPath`. | 268 /// `_config.precompiledPath`. |
269 bool _precompiled(String path) { | 269 bool _precompiled(String path) { |
270 if (_config.precompiledPath == null) return false; | 270 if (_config.precompiledPath == null) return false; |
271 var jsPath = | 271 var jsPath = |
272 p.join(_config.precompiledPath, p.relative(path, from: _root)) + | 272 p.join(_config.precompiledPath, p.relative(path, from: _root)) + |
273 ".browser_test.dart.js"; | 273 ".browser_test.dart.js"; |
274 print("does $jsPath exist? ${new File(jsPath).existsSync()}"); | |
275 return new File(jsPath).existsSync(); | 274 return new File(jsPath).existsSync(); |
276 } | 275 } |
277 | 276 |
278 StreamChannel loadChannel(String path, TestPlatform platform) => | 277 StreamChannel loadChannel(String path, TestPlatform platform) => |
279 throw new UnimplementedError(); | 278 throw new UnimplementedError(); |
280 | 279 |
281 /// Loads a test suite at [path] from the `pub serve` URL [dartUrl]. | 280 /// Loads a test suite at [path] from the `pub serve` URL [dartUrl]. |
282 /// | 281 /// |
283 /// This ensures that only one suite is loaded at a time, and that any errors | 282 /// This ensures that only one suite is loaded at a time, and that any errors |
284 /// are exposed as [LoadException]s. | 283 /// are exposed as [LoadException]s. |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 await Future.wait(futures); | 437 await Future.wait(futures); |
439 | 438 |
440 if (_config.pubServeUrl == null) { | 439 if (_config.pubServeUrl == null) { |
441 new Directory(_compiledDir).deleteSync(recursive: true); | 440 new Directory(_compiledDir).deleteSync(recursive: true); |
442 } else { | 441 } else { |
443 _http.close(); | 442 _http.close(); |
444 } | 443 } |
445 }); | 444 }); |
446 final _closeMemo = new AsyncMemoizer(); | 445 final _closeMemo = new AsyncMemoizer(); |
447 } | 446 } |
OLD | NEW |