createNetworkingEngine(getPreloadManager) {
    if (!getPreloadManager) {
      getPreloadManager = () => null;
    }

    const getAbrManager = () => {
      if (getPreloadManager()) {
        return getPreloadManager().getAbrManager();
      } else {
        return this.abrManager_;
      }
    };
    const getParser = () => {
      if (getPreloadManager()) {
        return getPreloadManager().getParser();
      } else {
        return this.parser_;
      }
    };
    const lateQueue = (fn) => {
      if (getPreloadManager()) {
        getPreloadManager().addQueuedOperation(true, fn);
      } else {
        fn();
      }
    };
    const dispatchEvent = (event) => {
      if (getPreloadManager()) {
        getPreloadManager().dispatchEvent(event);
      } else {
        this.dispatchEvent(event);
      }
    };
    const getStats = () => {
      if (getPreloadManager()) {
        return getPreloadManager().getStats();
      } else {
        return this.stats_;
      }
    };
    /** @type {shaka.net.NetworkingEngine.onProgressUpdated} */
    const onProgressUpdated_ = (deltaTimeMs,
        bytesDownloaded, allowSwitch, request, context) => {
      // In some situations, such as during offline storage, the abr manager
      // might not yet exist. Therefore, we need to check if abr manager has
      // been initialized before using it.
      const abrManager = getAbrManager();
      if (abrManager) {
        abrManager.segmentDownloaded(deltaTimeMs, bytesDownloaded,
            allowSwitch, request, context);
      }
    };
    /** @type {shaka.net.NetworkingEngine.OnHeadersReceived} */
    const onHeadersReceived_ = (headers, request, requestType) => {
      // Release a 'downloadheadersreceived' event.
      const name = shaka.util.FakeEvent.EventName.DownloadHeadersReceived;
      const data = new Map()
          .set('headers', headers)
          .set('request', request)
          .set('requestType', requestType);
      dispatchEvent(shaka.Player.makeEvent_(name, data));
      lateQueue(() => {
        if (this.cmsdManager_) {
          this.cmsdManager_.processHeaders(headers);
        }
      });
    };
    /** @type {shaka.net.NetworkingEngine.OnDownloadCompleted} */
    const onDownloadCompleted_ = (request, response) => {
      // Release a 'downloadcompleted' event.
      const name = shaka.util.FakeEvent.EventName.DownloadCompleted;
      const data = new Map()
          .set('request', request)
          .set('response', response);
      dispatchEvent(shaka.Player.makeEvent_(name, data));
    };
    /** @type {shaka.net.NetworkingEngine.OnDownloadFailed} */
    const onDownloadFailed_ = (request, error, httpResponseCode, aborted) => {
      // Release a 'downloadfailed' event.
      const name = shaka.util.FakeEvent.EventName.DownloadFailed;
      const data = new Map()
          .set('request', request)
          .set('error', error)
          .set('httpResponseCode', httpResponseCode)
          .set('aborted', aborted);
      dispatchEvent(shaka.Player.makeEvent_(name, data));
    };
    /** @type {shaka.net.NetworkingEngine.OnRequest} */
    const onRequest_ = (type, request, context) => {
      lateQueue(() => {
        this.cmcdManager_.applyRequestData(type, request, context);
      });
    };

    /** @type {shaka.net.NetworkingEngine.OnRetry} */
    const onRetry_ = (type, context, newUrl, oldUrl) => {
      const parser = getParser();
      if (parser && parser.banLocation) {
        parser.banLocation(oldUrl);
      }
    };

    /** @type {shaka.net.NetworkingEngine.OnResponse} */
    const onResponse_ = (type, response, context) => {
      if (response.data) {
        const bytesDownloaded = response.data.byteLength;
        const stats = getStats();
        if (stats) {
          stats.addBytesDownloaded(bytesDownloaded);
          if (type === shaka.net.NetworkingEngine.RequestType.MANIFEST) {
            stats.setManifestSize(bytesDownloaded);
          }
        }
      }
    };

    const networkingEngine = new shaka.net.NetworkingEngine(
        onProgressUpdated_, onHeadersReceived_, onDownloadCompleted_,
        onDownloadFailed_, onRequest_, onRetry_, onResponse_);
    networkingEngine.configure(this.config_.networking);
    return networkingEngine;
  }
Creates a new instance of NetworkingEngine.  This can be replaced by tests
to create fake instances instead.

@param {(function():?shaka.media.PreloadManager)=} getPreloadManager
@return {!shaka.net.NetworkingEngine}