blob: 9f88e9581d83a46cb3cfd437a59264a031253d74 [file] [log] [blame] [edit]
<!DOCTYPE html><!-- webkit-test-runner [ RequestIdleCallbackEnabled=true UsesBackForwardCache=true ] -->
<html>
<body>
<script src="../resources/js-test.js"></script>
<style>
@-webkit-keyframes bounce {
from {
-webkit-transform: translate3d(0,0,0);
}
to {
-webkit-transform: translate3d(200px,0,0);
}
}
#animator {
position: relative;
top: 0px;
width: 100px;
height: 100px;
background-color: blue;
-webkit-animation-name: bounce;
-webkit-animation-duration: 80ms;
-webkit-animation-iteration-count: infinite;
}
</style>
<div id="animator"></div>
<script>
description('This tests that requestIdleCallback will execute the function even when there is a pending task for a suspended document');
jsTestIsAsync = true;
const iframe = document.createElement('iframe');
document.body.appendChild(iframe);
window.addEventListener("pagehide", function(event) {
requestIdleCallback(() => console.log('FAIL - idle callback executed'));
iframe.contentWindow.requestIdleCallback(() => console.log('FAIL - idle callback in iframe executed'));
internals.queueTask('DOMManipulation', () => { });
});
onload = () => {
setTimeout(() => {
window.location = 'resources/page-cache-with-pending-task.html';
}, 0);
}
</script>
</body>
</html>