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

Issue 10966020: Added support for running an HTTP server during the test and being able to serve up static files. L… (Closed)

Created:
8 years, 3 months ago by gram
Modified:
8 years, 3 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Added support for running an HTTP server during the test and being able to serve up static files. Later this will be extended to being able to write tests on both ends of the connection, but this is a first step. Committed: https://code.google.com/p/dart/source/detail?r=12674

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 17

Patch Set 4 : #

Patch Set 5 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -58 lines) Patch
A utils/testrunner/client_server_task.dart View 1 2 3 1 chunk +38 lines, -0 lines 0 comments Download
M utils/testrunner/configuration.dart View 2 chunks +7 lines, -1 line 0 comments Download
M utils/testrunner/dart2js_task.dart View 1 2 3 1 chunk +9 lines, -9 lines 0 comments Download
D utils/testrunner/dart_task.dart View 1 chunk +0 lines, -17 lines 0 comments Download
M utils/testrunner/dart_wrap_task.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M utils/testrunner/delete_task.dart View 1 chunk +1 line, -1 line 0 comments Download
D utils/testrunner/drt_task.dart View 1 chunk +0 lines, -14 lines 0 comments Download
M utils/testrunner/html_wrap_task.dart View 1 chunk +1 line, -1 line 0 comments Download
A utils/testrunner/http_server_test_runner.dart View 1 2 3 4 1 chunk +119 lines, -0 lines 4 comments Download
M utils/testrunner/options.dart View 1 chunk +8 lines, -0 lines 0 comments Download
M utils/testrunner/run_process_task.dart View 2 chunks +3 lines, -8 lines 0 comments Download
M utils/testrunner/testrunner.dart View 2 chunks +15 lines, -5 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
gram
8 years, 3 months ago (2012-09-20 21:06:28 UTC) #1
Siggi Cherem (dart-lang)
https://chromiumcodereview.appspot.com/10966020/diff/4001/utils/testrunner/client_server_task.dart File utils/testrunner/client_server_task.dart (right): https://chromiumcodereview.appspot.com/10966020/diff/4001/utils/testrunner/client_server_task.dart#newcode1 utils/testrunner/client_server_task.dart:1: +copyright, + docs, + #library https://chromiumcodereview.appspot.com/10966020/diff/4001/utils/testrunner/client_server_task.dart#newcode14 utils/testrunner/client_server_task.dart:14: 1000*timeout); spaces ...
8 years, 3 months ago (2012-09-20 23:55:41 UTC) #2
gram
ptal https://codereview.chromium.org/10966020/diff/4001/utils/testrunner/client_server_task.dart File utils/testrunner/client_server_task.dart (right): https://codereview.chromium.org/10966020/diff/4001/utils/testrunner/client_server_task.dart#newcode1 utils/testrunner/client_server_task.dart:1: On 2012/09/20 23:55:41, sigmund wrote: > +copyright, + ...
8 years, 3 months ago (2012-09-21 00:25:46 UTC) #3
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/10966020/diff/4001/utils/testrunner/client_server_task.dart File utils/testrunner/client_server_task.dart (right): https://codereview.chromium.org/10966020/diff/4001/utils/testrunner/client_server_task.dart#newcode1 utils/testrunner/client_server_task.dart:1: On 2012/09/21 00:25:46, gram wrote: > On 2012/09/20 ...
8 years, 3 months ago (2012-09-21 00:37:53 UTC) #4
Søren Gjesse
8 years, 3 months ago (2012-09-21 07:08:09 UTC) #5
Drive by comments

https://chromiumcodereview.appspot.com/10966020/diff/7002/utils/testrunner/ht...
File utils/testrunner/http_server_test_runner.dart (right):

https://chromiumcodereview.appspot.com/10966020/diff/7002/utils/testrunner/ht...
utils/testrunner/http_server_test_runner.dart:62: }
These two lines are not needed. The default status code is HttpStatus.OK. If no
reason phrase is specified there is a default mapping from status code to reason
phrase.

https://chromiumcodereview.appspot.com/10966020/diff/7002/utils/testrunner/ht...
utils/testrunner/http_server_test_runner.dart:64: response.reasonPhrase = "OK";
Here you can just do

  f.openInputStream().pipe(response.outputStream);

instead of

  var content = f.readAsBytesSync();
  response.outputStream.write(content);
  response.outputStream.close();

pipe will close the output stream when done.

https://chromiumcodereview.appspot.com/10966020/diff/7002/utils/testrunner/ht...
utils/testrunner/http_server_test_runner.dart:69: response.statusCode =
HttpStatus.NOT_FOUND;
No need to set reason phrase.

https://chromiumcodereview.appspot.com/10966020/diff/7002/utils/testrunner/ht...
utils/testrunner/http_server_test_runner.dart:76: response.reasonPhrase = "$e";
Maybe add

response.writeString(s.toString());

Powered by Google App Engine
This is Rietveld 408576698