Sets a message handler that intercepts outgoing messages in binary form.
The given callback will replace the currently registered callback (if any).
To remove the mock handler, pass null
as the handler
argument.
Source
static void setMockBinaryMessageHandler(String channel, Future<ByteData> handler(ByteData message)) { if (handler == null) _mockHandlers.remove(channel); else _mockHandlers[channel] = handler; }