navigate-anchor-same-url.html (774B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <a id="a" href="/navigation-api/navigate-event/navigate-anchor-same-url.html"></a> 5 <script> 6 promise_test(async t => { 7 await new Promise(resolve => window.addEventListener('load', resolve, {once: true})); 8 9 const { promise, resolve } = Promise.withResolvers(); 10 navigation.onnavigate = t.step_func_done(e => { 11 assert_equals(e.navigationType, "replace"); 12 assert_equals(new URL(e.destination.url).pathname, 13 "/navigation-api/navigate-event/navigate-anchor-same-url.html"); 14 resolve(); 15 e.intercept({handler: () => {}}); 16 }); 17 a.click(); 18 19 return promise; 20 }, "<a> to identical url is a replace navigation"); 21 </script>