async function networkCancelTest(interruption) {
      const delays = [];
      /** @type {!shaka.util.PublicPromise} */
      const aRequestIsStarted = new shaka.util.PublicPromise();

      // Set delays for the URIs of the manifest.
      const uris = [segment1Uri, segment2Uri, segment3Uri, segment4Uri];
      for (let i = 0; i < uris.length; i++) {
        const promise = new shaka.util.PublicPromise();
        delays.push(promise);

        // The fake networking engine provides a "abortCheck" callback to the
        // response, so that you can check whether or not the network operation
        // has been aborted.
        netEngine.setResponse(uris[i], async (abortCheck) => {
          aRequestIsStarted.resolve();
          await promise;

          expect(abortCheck()).toBe(true);

          return new ArrayBuffer(16);
        });
      }

      /** @type {!shaka.extern.IAbortableOperation} */
      const storeOperation = storage.store(
          manifestWithPerStreamBandwidthUri, noMetadata, fakeMimeType);
      await aRequestIsStarted;
      const interruptionPromise = interruption(storeOperation);
      for (const promise of delays) {
        promise.resolve();
      }
      await interruptionPromise;

      const expected = Util.jasmineError(new shaka.util.Error(
          shaka.util.Error.Severity.CRITICAL,
          shaka.util.Error.Category.STORAGE,
          shaka.util.Error.Code.OPERATION_ABORTED));
      await expectAsync(storeOperation.promise).toBeRejectedWith(expected);
    }
@param {function(shaka.extern.IAbortableOperation):!Promise} interruption