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

Unified Diff: tools/testing/dart/http_server.dart

Issue 2903703002: Tighten types in test.dart even more. (Closed)
Patch Set: Play nicer with strong mode. Created 3 years, 7 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 | « tools/testing/dart/html_test.dart ('k') | tools/testing/dart/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/http_server.dart
diff --git a/tools/testing/dart/http_server.dart b/tools/testing/dart/http_server.dart
index 8902adf76e090f97cbecf4e50bca669015fa50cd..53538fd579f8e42f73682e576e71dd56d1379bb1 100644
--- a/tools/testing/dart/http_server.dart
+++ b/tools/testing/dart/http_server.dart
@@ -88,15 +88,20 @@ void main(List<String> arguments) {
help: 'The runtime we are using (for csp flags).', defaultsTo: 'none');
var args = parser.parse(arguments);
- if (args['help']) {
+ if (args['help'] as bool) {
print(parser.getUsage());
} else {
- var servers = new TestingServers(args['build-directory'], args['csp'],
- args['runtime'], null, args['package-root'], args['packages']);
- var port = int.parse(args['port']);
- var crossOriginPort = int.parse(args['crossOriginPort']);
+ var servers = new TestingServers(
+ args['build-directory'] as String,
+ args['csp'] as bool,
+ args['runtime'] as String,
+ null,
+ args['package-root'] as String,
+ args['packages'] as String);
+ var port = int.parse(args['port'] as String);
+ var crossOriginPort = int.parse(args['crossOriginPort'] as String);
servers
- .startServers(args['network'],
+ .startServers(args['network'] as String,
port: port, crossOriginPort: crossOriginPort)
.then((_) {
DebugLogger.info('Server listening on port ${servers.port}');
@@ -212,7 +217,8 @@ class TestingServers {
DebugLogger.error('HttpServer: an error occured', e);
}
- Future _startHttpServer(String host, {int port: 0, int allowedPort: -1}) {
+ Future<DispatchingServer> _startHttpServer(String host,
+ {int port: 0, int allowedPort: -1}) {
return HttpServer.bind(host, port).then((HttpServer httpServer) {
var server = new DispatchingServer(httpServer, _onError, _sendNotFound);
server.addHandler('/echo', _handleEchoRequest);
« no previous file with comments | « tools/testing/dart/html_test.dart ('k') | tools/testing/dart/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698