url-parsing.html (872B)
1 <!DOCTYPE html> 2 <title>Request constructor URL parsing, with multiple globals in play</title> 3 <link rel="help" href="https://fetch.spec.whatwg.org/#dom-request"> 4 <link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 8 <!-- This is the entry global --> 9 10 <iframe src="incumbent/incumbent.html"></iframe> 11 12 <script> 13 'use strict'; 14 15 const loadPromise = new Promise(resolve => { 16 window.addEventListener("load", () => resolve()); 17 }); 18 19 promise_test(() => { 20 return loadPromise.then(() => { 21 const req = document.querySelector('iframe').contentWindow.createRequest("url"); 22 23 assert_equals(req.url, new URL("current/success/url", location.href).href); 24 }); 25 }, "should parse the URL relative to the current settings object"); 26 27 </script>