Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Unified Diff: tests/standalone/http_launch_test.dart

Issue 46063010: Change dart:io Platform.script to return a Uri. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/debugger/debug_lib.dart ('k') | tests/standalone/io/code_collection_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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']);
« no previous file with comments | « tests/standalone/debugger/debug_lib.dart ('k') | tests/standalone/io/code_collection_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698