blob: c484b8684c94d1bf1f7badf13ffb67024fce20e5 [file] [log] [blame]
<!doctype HTML>
<!--
Runs an acquire(), then commits without connecting the element, which should just unlock and fail.
-->
<style>
#container {
contain: style layout;
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(() => {
container.getDisplayLock().commit().then(
() => { finishTest("FAIL"); },
() => {
document.body.appendChild(container);
finishTest("PASS");
});
});
}
window.onload = runTest;
</script>