test_bug1422334.html (1575B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Ensure that reload after replaceState after 3xx redirect does the right thing.</title> 6 <script src="/tests/SimpleTest/SimpleTest.js"></script> 7 <link rel="stylesheet" href="/tests/SimpleTest/test.css"/> 8 <script> 9 SimpleTest.waitForExplicitFinish(); 10 addLoadEvent(function() { 11 var ifr = document.querySelector("iframe"); 12 var win = ifr.contentWindow; 13 is(win.location.href, location.href.replace(location.search, "") 14 .replace("mochitest/test_bug1422334.html", 15 "navigation/blank.html?x=y"), 16 "Should have the right location on initial load"); 17 18 win.history.replaceState(null, '', win.location.pathname); 19 is(win.location.href, location.href.replace(location.search, "") 20 .replace("mochitest/test_bug1422334.html", 21 "navigation/blank.html"), 22 "Should have the right location after replaceState call"); 23 24 ifr.onload = function() { 25 is(win.location.href, location.href.replace(location.search, "") 26 .replace("mochitest/test_bug1422334.html", 27 "navigation/blank.html"), 28 "Should have the right location after reload"); 29 SimpleTest.finish(); 30 } 31 win.location.reload(); 32 }); 33 </script> 34 </head> 35 <body> 36 <p id="display"><iframe src="bug1422334_redirect.html"></iframe></p> 37 <div id="content" style="display: none"></div> 38 <pre id="test"></pre> 39 </body> 40 </html>