| 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 library test.runner.browser.server; | 5 library test.runner.browser.server; |
| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 Future<Suite> loadSuite(String path) { | 158 Future<Suite> loadSuite(String path) { |
| 159 return new Future.sync(() { | 159 return new Future.sync(() { |
| 160 if (_pubServeUrl != null) { | 160 if (_pubServeUrl != null) { |
| 161 var suitePrefix = p.withoutExtension(p.relative(path, from: 'test')) + | 161 var suitePrefix = p.withoutExtension(p.relative(path, from: 'test')) + |
| 162 '.browser_test'; | 162 '.browser_test'; |
| 163 var jsUrl = _pubServeUrl.resolve('$suitePrefix.dart.js'); | 163 var jsUrl = _pubServeUrl.resolve('$suitePrefix.dart.js'); |
| 164 return _pubServeSuite(path, jsUrl) | 164 return _pubServeSuite(path, jsUrl) |
| 165 .then((_) => _pubServeUrl.resolve('$suitePrefix.html')); | 165 .then((_) => _pubServeUrl.resolve('$suitePrefix.html')); |
| 166 } else { | 166 } else { |
| 167 return _compileSuite(path).then((dir) { | 167 return _compileSuite(path).then((dir) { |
| 168 if (_closed) return null; |
| 169 |
| 168 // Add a trailing slash because at least on Chrome, the iframe's | 170 // Add a trailing slash because at least on Chrome, the iframe's |
| 169 // window.location.href will do so automatically, and if that differs | 171 // window.location.href will do so automatically, and if that differs |
| 170 // from the original URL communication will fail. | 172 // from the original URL communication will fail. |
| 171 return url.resolve( | 173 return url.resolve( |
| 172 "/" + p.toUri(p.relative(dir, from: _compiledDir)).path + "/"); | 174 "/" + p.toUri(p.relative(dir, from: _compiledDir)).path + "/"); |
| 173 }); | 175 }); |
| 174 } | 176 } |
| 175 }).then((suiteUrl) { | 177 }).then((suiteUrl) { |
| 176 if (_closed) return null; | 178 if (_closed) return null; |
| 177 | 179 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 if (_pubServeUrl == null) { | 264 if (_pubServeUrl == null) { |
| 263 new Directory(_compiledDir).deleteSync(recursive: true); | 265 new Directory(_compiledDir).deleteSync(recursive: true); |
| 264 } else { | 266 } else { |
| 265 _http.close(); | 267 _http.close(); |
| 266 } | 268 } |
| 267 | 269 |
| 268 _closeCompleter.complete(); | 270 _closeCompleter.complete(); |
| 269 }).catchError(_closeCompleter.completeError); | 271 }).catchError(_closeCompleter.completeError); |
| 270 } | 272 } |
| 271 } | 273 } |
| OLD | NEW |