blob: d7043a19028fc114f109a2ddbac26df242fe01f9 [file] [log] [blame]
<!doctype HTML>
<!--
Runs an acquire(), then calls update() but disconnects the element before update finishes.
-->
<style>
#container {
contain: content;
width: 100px;
height: 100px;
background: lightblue;
}
</style>
<div id="log"></div>
<script>
// TODO(vmpstr): In WPT this needs to be replaced with reftest-wait.
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 runTest() {
let container = document.createElement("div");
container.id = "container";
container.getDisplayLock().acquire({ timeout: Infinity }).then(() => {
document.body.appendChild(container);
container.getDisplayLock().update().then(
() => { finishTest("FAIL"); },
() => { finishTest("PASS"); });
container.remove();
});
}
window.onload = runTest;
</script>