Index: tests/standalone/http_launch_test.dart |
diff --git a/tests/standalone/http_launch_test.dart b/tests/standalone/http_launch_test.dart |
index cebab776a592069a5923cfbd154ae2e2212c367f..5404f0ff5877ded9fb45747b0c8a6c7c3ad29dc9 100644 |
--- a/tests/standalone/http_launch_test.dart |
+++ b/tests/standalone/http_launch_test.dart |
@@ -19,8 +19,7 @@ import 'dart:io'; |
import 'package:expect/expect.dart'; |
String pathToExecutable = Platform.executable; |
-String pathOfData = new File(Platform.script).parent.path + |
- '/http_launch_data'; |
+Uri pathOfData = Platform.script.resolve('http_launch_data/'); |
int port; |
_sendNotFound(HttpResponse response) { |
@@ -29,9 +28,9 @@ _sendNotFound(HttpResponse response) { |
} |
handleRequest(HttpRequest request) { |
- final String path = request.uri.path; |
- final String requestPath = '$pathOfData$path'; |
- final File file = new File(requestPath); |
+ final String path = request.uri.path.substring(1); |
+ final Uri requestPath = pathOfData.resolve(path); |
+ final File file = new File(requestPath.toFilePath()); |
file.exists().then((bool found) { |
if (found) { |
file.openRead() |
@@ -47,7 +46,8 @@ serverRunning(HttpServer server) { |
port = server.port; |
server.listen(handleRequest); |
Future<ProcessResult> no_http_run = |
- Process.run(pathToExecutable, ['${pathOfData}/http_launch_main.dart']); |
+ Process.run(pathToExecutable, |
+ [pathOfData.resolve('http_launch_main.dart').toFilePath()]); |
Future<ProcessResult> http_run = |
Process.run(pathToExecutable, |
['http://127.0.0.1:$port/http_launch_main.dart']); |