blob: 32444df4cf28be3e8e53bf3e9d7d7934243b4eac [file] [log] [blame]
<!doctype HTML>
<!--
Runs an acquireDisplayLock, which suspends the context.
The associated promise should never resolve.
-->
<style>
#container {
contain: content;
width: 100px;
height: 100px;
}
</style>
<div id="log"></div>
<script>
if (window.testRunner)
window.testRunner.waitUntilDone();
function finishTest(status_string) {
if (document.getElementById("log").innerHTML === "")
document.getElementById("log").innerHTML = status_string;
if (window.testRunner)
window.testRunner.notifyDone();
}
function acquire() {
let container = document.createElement("div");
container.id = "container";
container.acquireDisplayLock((context) => { context.suspend(); }).then(
() => { finishTest("FAIL"); },
() => { finishTest("FAIL"); });
document.body.appendChild(container);
setTimeout(() => { finishTest("PASS"); }, 100);
}
window.onload = acquire;
</script>