https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 962d90000cca374f4756bc65ea024e06c0150499 authored by Philip Jägenstedt on 22 December 2018, 11:59:40 UTC
DO NOT MERGE: probe for idlharness.js flakiness
Tip revision: 962d900
access-control-expose-headers-parsing.window.js
promise_test(() => fetch("resources/access-control-expose-headers.json").then(res => res.json()).then(runTests), "Loading JSON…");

function runTests(allTestData) {
  allTestData.forEach(testData => {
    const encodedInput = encodeURIComponent(testData.input);
    promise_test(() => {
      const relativeURL = "resources/expose-headers.py?expose=" + encodedInput,
            url = new URL(relativeURL, location.href).href.replace("://", "://élève.");
      return fetch(url).then(res => {
        assert_equals(res.headers.get("content-language"), "mkay");
        assert_equals(res.headers.get("bb-8"), (testData.exposed ? "hey" : null));
      });
    }, "Parsing: " + encodedInput);
  })
}
back to top