| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 http_server; | 5 library http_server; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'dart:convert' show | 10 import 'dart:convert' show |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 Future startServers(String host, {int port: 0, int crossOriginPort: 0}) { | 165 Future startServers(String host, {int port: 0, int crossOriginPort: 0}) { |
| 166 return _startHttpServer(host, port: port).then((server) { | 166 return _startHttpServer(host, port: port).then((server) { |
| 167 _server = server; | 167 _server = server; |
| 168 return _startHttpServer(host, | 168 return _startHttpServer(host, |
| 169 port: crossOriginPort, | 169 port: crossOriginPort, |
| 170 allowedPort:_serverList[0].port); | 170 allowedPort:_serverList[0].port); |
| 171 }); | 171 }); |
| 172 } | 172 } |
| 173 | 173 |
| 174 String httpServerCommandline() { | 174 String httpServerCommandline() { |
| 175 var dart = TestUtils.dartTestExecutable.toNativePath(); | 175 var dart = Platform.resolvedExecutable; |
| 176 var dartDir = TestUtils.dartDir; | 176 var dartDir = TestUtils.dartDir; |
| 177 var script = dartDir.join(new Path("tools/testing/dart/http_server.dart")); | 177 var script = dartDir.join(new Path("tools/testing/dart/http_server.dart")); |
| 178 var buildDirectory = _buildDirectory.toNativePath(); | 178 var buildDirectory = _buildDirectory.toNativePath(); |
| 179 var csp = useContentSecurityPolicy ? '--csp ' : ''; | 179 var csp = useContentSecurityPolicy ? '--csp ' : ''; |
| 180 return '$dart $script -p $port -c $crossOriginPort $csp' | 180 return '$dart $script -p $port -c $crossOriginPort $csp' |
| 181 '--build-directory=$buildDirectory --runtime=$runtime ' | 181 '--build-directory=$buildDirectory --runtime=$runtime ' |
| 182 '--package-root=$_packageRoot'; | 182 '--package-root=$_packageRoot'; |
| 183 } | 183 } |
| 184 | 184 |
| 185 void stopServers() { | 185 void stopServers() { |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 class _Entry implements Comparable { | 462 class _Entry implements Comparable { |
| 463 final String name; | 463 final String name; |
| 464 final String displayName; | 464 final String displayName; |
| 465 | 465 |
| 466 _Entry(this.name, this.displayName); | 466 _Entry(this.name, this.displayName); |
| 467 | 467 |
| 468 int compareTo(_Entry other) { | 468 int compareTo(_Entry other) { |
| 469 return name.compareTo(other.name); | 469 return name.compareTo(other.name); |
| 470 } | 470 } |
| 471 } | 471 } |
| OLD | NEW |