async function testFails(uri, expected) {
    const request = shaka.net.NetworkingEngine.makeRequest(
        [uri], retryParameters);

    const p = plugin(
        uri, request, requestType, progressUpdated, headersReceived, {})
        .promise;
    if (expected.code == shaka.util.Error.Code.TIMEOUT) {
      jasmine.clock().tick(5000);
    }
    await expectAsync(p).toBeRejectedWith(expected);
  }
@param {string} uri
@param {shaka.util.Error} expected