function simulateCloseEvent(ws) {
  /** @suppress {visibility} suppression added to enable type checking */
  ws.readyState = NetWebSocket.ReadyState_.CLOSED;
  ws.onclose({data: 'mock close event'});
}
Simulates the browser firing the close event for the given web socket.
@param {MockWebSocket} ws The mock web socket.
@suppress {missingProperties} suppression added to enable type checking