blob: cc2c20b091b4bb5d039068a29d8906fa09397915 [file] [log] [blame]
<!DOCTYPE html>
<head>
<title>timer callback after preload mode test</title>
<style>
h1 {
color: #c50000;
}
</style>
<script src='black_box_js_test_utils.js'></script>
</head>
<body>
<h1>
<span>To test timer behavior after preload and continue</span>
</h1>
<script>
let setIntervalCalledTimes = 0;
let setTimeoutCalledTimes = 0;
function IsTestComplete() {
return setTimeoutCalledTimes > 0 && setIntervalCalledTimes > 0;
}
let set_interval_id = setInterval(() => {
setIntervalCalledTimes ++;
if (IsTestComplete()) {
onEndTest();
}
}, 1100);
setTimeout(() => {
setTimeoutCalledTimes ++;
if (IsTestComplete()) {
onEndTest();
}
}, 2250);
let NewElement = document.createElement('div');
NewElement.setAttribute('id', 'script_executed');
document.appendChild(NewElement);
</script>
</body>