Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /fetch/api/response/multi-globals/url-parsing.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Response.redirect URL parsing, with multiple globals in play</title>
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- This is the entry global -->
<iframe src="incumbent/incumbent.html"></iframe>
<script>
'use strict';
const loadPromise = new Promise(resolve => {
window.addEventListener("load", () => resolve());
});
promise_test(() => {
return loadPromise.then(() => {
const res = document.querySelector('iframe').contentWindow.createRedirectResponse("url");
assert_equals(res.headers.get("Location"), new URL("current/success/url", location.href).href);
});
}, "should parse the redirect Location URL relative to the current settings object");
</script>