1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/test/file_bug426646-1.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 +<html><head> 1.5 +<title>Bug 426646, Using location.replace breaks iframe history</title> 1.6 +<script type="text/javascript"> 1.7 +var url1 = "data:text/html;charset=utf-8,1st%20page"; 1.8 + 1.9 +function soon(f) { 1.10 + return function() { setTimeout(f, 0); }; 1.11 +} 1.12 + 1.13 +function doe() { 1.14 + document.body.innerHTML = "<iframe src='about:blank'></iframe>"; 1.15 + document.body.innerHTML += "<iframe src='about:blank'></iframe>"; 1.16 + window.frames[0].frameElement.onload = soon(doe2); 1.17 + window.frames[0].location.replace(url1); 1.18 +} 1.19 + 1.20 +function doe2() { 1.21 + window.frames[0].location = 'data:text/html;charset=utf-8,2nd%20page'; 1.22 + window.frames[0].frameElement.onload = soon(doe3); 1.23 +} 1.24 + 1.25 +function doe3() { 1.26 + window.frames[0].frameElement.onload = soon(doe4); 1.27 + history.go(-1); 1.28 +} 1.29 + 1.30 +function doe4() { 1.31 + opener.is(window.frames[0].location, url1, "History.go(-1) didn't work?"); 1.32 + opener.is(window.frames[1].location, "about:blank", 1.33 + "History.go(-1) didn't work?"); 1.34 + close(); 1.35 +} 1.36 +</script> 1.37 +</head> 1.38 +<body onload="doe();" onunload="opener.nextTest();"> 1.39 +</body></html>