Commit 50a48387 authored by liyuqian's avatar liyuqian Committed by Kate Lovett

Change Future.done to Future.whenComplete (#36270)

This is for the missed comment in
https://github.com/flutter/flutter/pull/36089#discussion_r303960949
parent 5e650af7
......@@ -409,7 +409,7 @@ class FlutterDriver {
final String webSocketUrl = _getWebSocketUrl(_dartVmReconnectUrl);
final WebSocket ws = await WebSocket.connect(webSocketUrl);
ws.done.then((dynamic _) => _checkCloseCode(ws));
ws.done.whenComplete(() => _checkCloseCode(ws));
_peer = rpc.Peer(
IOWebSocketChannel(ws).cast(),
onUnhandledError: _unhandledJsonRpcError,
......@@ -1138,8 +1138,8 @@ Future<VMServiceClientConnection> _waitAndConnect(String url) async {
ws1 = await WebSocket.connect(webSocketUrl);
ws2 = await WebSocket.connect(webSocketUrl);
ws1.done.then((dynamic _) => _checkCloseCode(ws1));
ws2.done.then((dynamic _) => _checkCloseCode(ws2));
ws1.done.whenComplete(() => _checkCloseCode(ws1));
ws2.done.whenComplete(() => _checkCloseCode(ws2));
return VMServiceClientConnection(
VMServiceClient(IOWebSocketChannel(ws1).cast()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment