blob: 5b6859d5e2b099c53a14d465673e126ea29f4df5 [file] [edit]
<!DOCTYPE html><!-- webkit-test-runner [ UsesBackForwardCache=true ] -->
<html>
<body>
<script src="../../resources/js-test.js"></script>
<script>
jsTestIsAsync = true;
onpageshow = (event) => {
if (event.persisted) {
shouldBeEqualToString('event.type', 'pageshow');
shouldBe('event.target', 'document');
shouldBe('event.composedPath().length', '1');
shouldBe('event.composedPath()[0]', 'window');
window.onpagehide = null;
setTimeout(() => {
if (window.testRunner)
testRunner.notifyDone();
}, 0);
}
}
window.onpagehide = (event) => {
shouldBeEqualToString('event.type', 'pagehide');
shouldBe('event.target', 'document');
shouldBe('event.composedPath().length', '1');
shouldBe('event.composedPath()[0]', 'window');
}
onload = () => {
setTimeout(() => {
blob = new Blob(['<!DOCTYPE html><script>history.back();</' + 'script>'], { type: "text/html" });
location.href = URL.createObjectURL(blob);
}, 0);
}
</script>
</body>
</html>