blob: 2e34f4962c94fc0ee6d89670fa6e5e23fa7d384c [file] [log] [blame]
<!-- webkit-test-runner [ enablePageCache=true ] -->
<!DOCTYPE html>
<html>
<body>
<p>This tests executing a script while being restored from a page cache. WebKit should not hit a release assertion.</p>
<div id="result">
<input id="input">
<button onclick="runTest()">Start test</button>
</div>
<script>
if (window.testRunner) {
testRunner.clearBackForwardList();
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
window.addEventListener("pageshow", (event) => {
if (event.persisted)
return;
if (window.testRunner)
setTimeout(runTest, 0);
});
function runTest()
{
input.setAttribute('autofocus', '');
document.getElementById('input').addEventListener('focus', finish);
location.href = 'resources/page-cache-helper.html';
}
function finish()
{
document.getElementById('result').textContent = 'PASS';
setTimeout(() => {
if (window.testRunner)
testRunner.notifyDone();
}, 0);
}
</script>
</body>
</html>