blob: 6a97d67a577cba694d1d84cc8cb7c72fdcaa15e3 [file] [log] [blame]
<script>
shouldFinishJSOnXHRLoad = false;
function doXHR()
{
xhr = new XMLHttpRequest();
xhr.open("GET", "/navigation/resources/slow-resource.pl?delay=1000");
xhr.addEventListener("load", () => {
if (shouldFinishJSOnXHRLoad) {
parent.testPassed("XHR finished after restoring from the cache");
parent.restoredFromCache = false;
parent.finishJSTest();
} else
doXHR();
});
xhr.addEventListener("error", () => {
doXHR();
});
xhr.addEventListener("progress", () => {
});
xhr.send();
}
parent.debug("* iframe starting XHR");
doXHR();
parent.navigate();
</script>