javascript.window.js (539B)
1 async_test(t => { 2 const frame = document.createElement("iframe"); 3 t.add_cleanup(() => frame.remove()); 4 const path = "resources/javascript.asis"; 5 frame.src = path; 6 frame.onload = t.step_func(() => { 7 assert_equals(frame.contentWindow.location.href, new URL(path, self.location).href); 8 assert_equals(frame.contentWindow.x, 1); 9 t.step_timeout(() => { 10 assert_equals(frame.contentWindow.x, 1); 11 t.done(); 12 }, 100); 13 }); 14 document.body.appendChild(frame); 15 }, "Refresh to a javascript: URL should not work");