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

Unified Diff: tests/standalone/io/http_server_response_test.dart

Issue 53313007: Change dart:io Platform.script to return a URI. Change all uses of Platform.script to work with th… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix dom.py docs 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
Index: tests/standalone/io/http_server_response_test.dart
diff --git a/tests/standalone/io/http_server_response_test.dart b/tests/standalone/io/http_server_response_test.dart
index e1deb8d5064e3060620f2dddf3766baec50f6de8..60c350a99970aed4544159a984e6f1f118a8d71b 100644
--- a/tests/standalone/io/http_server_response_test.dart
+++ b/tests/standalone/io/http_server_response_test.dart
@@ -63,7 +63,7 @@ void testResponseDone() {
});
testServerRequest((server, request) {
- new File("__not_exitsing_file_").openRead().pipe(request.response)
+ new File("__nonexistent_file_").openRead().pipe(request.response)
.catchError((e) {
server.close();
});
@@ -80,10 +80,11 @@ void testResponseDone() {
void testResponseAddStream() {
- int bytes = new File(Platform.script).lengthSync();
+ File file = new File(Platform.script.toFilePath());
+ int bytes = file.lengthSync();
testServerRequest((server, request) {
- request.response.addStream(new File(Platform.script).openRead())
+ request.response.addStream(file.openRead())
.then((response) {
response.close();
response.done.then((_) => server.close());
@@ -91,9 +92,9 @@ void testResponseAddStream() {
}, bytes: bytes);
testServerRequest((server, request) {
- request.response.addStream(new File(Platform.script).openRead())
+ request.response.addStream(file.openRead())
.then((response) {
- request.response.addStream(new File(Platform.script).openRead())
+ request.response.addStream(file.openRead())
.then((response) {
response.close();
response.done.then((_) => server.close());
@@ -112,14 +113,14 @@ void testResponseAddStream() {
}, bytes: 0);
testServerRequest((server, request) {
- request.response.addStream(new File("__not_exitsing_file_").openRead())
+ request.response.addStream(new File("__nonexistent_file_").openRead())
.catchError((e) {
server.close();
});
});
testServerRequest((server, request) {
- new File("__not_exitsing_file_").openRead().pipe(request.response)
+ new File("__nonexistent_file_").openRead().pipe(request.response)
.catchError((e) {
server.close();
});
@@ -128,8 +129,9 @@ void testResponseAddStream() {
void testResponseAddStreamClosed() {
+ File file = new File(Platform.script.toFilePath());
testServerRequest((server, request) {
- request.response.addStream(new File(Platform.script).openRead())
+ request.response.addStream(file.openRead())
.then((response) {
response.close();
response.done.then((_) => server.close());
@@ -139,7 +141,7 @@ void testResponseAddStreamClosed() {
testServerRequest((server, request) {
int count = 0;
write() {
- request.response.addStream(new File(Platform.script).openRead())
+ request.response.addStream(file.openRead())
.then((response) {
request.response.write("sync data");
count++;
@@ -157,15 +159,16 @@ void testResponseAddStreamClosed() {
void testResponseAddClosed() {
+ File file = new File(Platform.script.toFilePath());
testServerRequest((server, request) {
- request.response.add(new File(Platform.script).readAsBytesSync());
+ request.response.add(file.readAsBytesSync());
request.response.close();
request.response.done.then((_) => server.close());
}, closeClient: true);
testServerRequest((server, request) {
for (int i = 0; i < 1000; i++) {
- request.response.add(new File(Platform.script).readAsBytesSync());
+ request.response.add(file.readAsBytesSync());
}
request.response.close();
request.response.done.then((_) => server.close());
@@ -174,7 +177,7 @@ void testResponseAddClosed() {
testServerRequest((server, request) {
int count = 0;
write() {
- request.response.add(new File(Platform.script).readAsBytesSync());
+ request.response.add(file.readAsBytesSync());
Timer.run(() {
count++;
if (count < 1000) {

Powered by Google App Engine
This is Rietveld 408576698