openRequest method

  1. @override
Future<Null> openRequest([
  1. Object? _
])
inherited

Open the request. If client is given, that client should be used to open the request.

This logic is platform-specific and should be implemented by the subclass.

Implementation

@override
Future<Null> openRequest([_]) async {
  _registerHandlers();

  // Allow the controller of this mock request to trigger an unexpected
  // exception to test the handling of said exception.
  if (_shouldFailToOpen) throw Exception('Mock request failed to open.');
}