navigate-relative-url.html (619B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <iframe id="i" src="/common/blank.html"></iframe> 5 <script> 6 async_test(t => { 7 window.onload = t.step_func(() => { 8 i.contentWindow.navigation.navigate("?1"); 9 i.onload = t.step_func_done(() => { 10 let iframe_url = new URL(i.contentWindow.navigation.currentEntry.url); 11 assert_equals(iframe_url.search, "?1"); 12 assert_equals(iframe_url.pathname, "/common/blank.html"); 13 }); 14 }); 15 }, "navigate() should resolve urls relative to navigation object, not the caller"); 16 </script>