requestImpl_(type, request) {
    expect(request).toBeTruthy();
    expect(request.uris.length).toBeLessThanOrEqual(this.maxUris_);

    const requestedUri = request.uris[0];

    const headers = this.headersMap_.get(requestedUri) || {};

    const defaultCallback = () => {
      return Promise.resolve(this.defaultResponse_);
    };

    const responses = this.responseMap_;
    const resultCallback = responses.get(requestedUri) || defaultCallback;

    // Cache the delay for this request now so that it does not change if
    // another request comes through.
    const delay = this.delayNextRequestPromise_;
    this.delayNextRequestPromise_ = null;

    let isAborted = false;
    const abortOp = () => {
      isAborted = true;
      return Promise.resolve();
    };
    const abortCheck = () => isAborted;

    // Wrap all the async operations into one function so that we can pass it to
    // abortable operation.
    const asyncOp = async () => {
      if (delay) {
        await delay;
      }

      const result = await resultCallback(abortCheck);
      if (isAborted) {
        throw new shaka.util.Error(
            shaka.util.Error.Severity.CRITICAL,
            shaka.util.Error.Category.STORAGE,
            shaka.util.Error.Code.OPERATION_ABORTED);
      }

      if (!result && request.method != 'HEAD') {
        // Provide some more useful information.
        shaka.log.error('Expected', requestedUri, 'to be in the response map');

        throw new shaka.util.Error(
            shaka.util.Error.Severity.CRITICAL,
            shaka.util.Error.Category.NETWORK,
            shaka.util.Error.Code.UNEXPECTED_TEST_REQUEST,
            requestedUri);
      }

      /** @type {shaka.extern.Response} */
      const response = {
        uri: requestedUri,
        originalUri: requestedUri,
        data: result,
        headers: headers,
        originalRequest: request,
      };

      // Modify the response using the response filter, this allows the app
      // to modify the response before giving it to the player.
      if (this.responseFilter_) {
        this.responseFilter_(type, response);
      }

      return response;
    };

    return new shaka.util.AbortableOperation(asyncOp(), abortOp);
  }
@param {shaka.net.NetworkingEngine.RequestType} type
@param {shaka.extern.Request} request
@return {!shaka.extern.IAbortableOperation.<shaka.extern.Response>}
@private