From d9a0de37471ae370493f50be5afcf230e0ed28dc Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Thu, 17 Nov 2016 23:07:20 -0800 Subject: [PATCH] Use InternetAddress instead of String (#6922) --- packages/flutter_tools/lib/src/test/flutter_platform.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/flutter_tools/lib/src/test/flutter_platform.dart b/packages/flutter_tools/lib/src/test/flutter_platform.dart index e422972ed9..680df4ca56 100644 --- a/packages/flutter_tools/lib/src/test/flutter_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_platform.dart @@ -20,7 +20,7 @@ import '../globals.dart'; import 'coverage_collector.dart'; final String _kSkyShell = Platform.environment['SKY_SHELL']; -const String _kHost = '127.0.0.1'; +final InternetAddress _kHost = InternetAddress.LOOPBACK_IP_V4; const String _kRunnerPath = '/runner'; const String _kShutdownPath = '/shutdown'; @@ -50,8 +50,8 @@ Future<_ServerInfo> _startServer() async { else if (!socket.isCompleted && request.uri.path == _kShutdownPath) socket.completeError('Failed to start test'); }); - return new _ServerInfo(server, 'ws://$_kHost:${server.port}$_kRunnerPath', - 'ws://$_kHost:${server.port}$_kShutdownPath', socket.future); + return new _ServerInfo(server, 'ws://${_kHost.address}:${server.port}$_kRunnerPath', + 'ws://${_kHost.address}:${server.port}$_kShutdownPath', socket.future); } Future _startProcess(String mainPath, { String packages, int observatoryPort }) { @@ -166,7 +166,7 @@ void main() { Process processToKill = process; process = null; CoverageCollector.instance.collectCoverage( - host: _kHost, + host: _kHost.address, port: observatoryPort, processToKill: processToKill );