summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/fetch/test_fetch_cached_redirect.js
blob: 48d9b2231fa9e943d0500a2bcee7e7f9036f6892 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
async function testCachedRedirectErrorMode() {
  // This is a file that returns a 302 to someplace else and will be cached.
  const REDIRECTING_URL = "file_fetch_cached_redirect.html";

  let firstResponse = await fetch(REDIRECTING_URL, { redirect: "manual" });
  // okay, now it should be in the cahce.
  try {
    let secondResponse = await fetch(REDIRECTING_URL, { redirect: "error" });
  } catch (ex) {}

  ok(true, "didn't crash");
}

function runTest() {
  return Promise.resolve().then(testCachedRedirectErrorMode);
  // Put more promise based tests here.
}