blob: 8ff66bf7189e0e66febbd7a95ce653017ab3e068 [file] [log] [blame]
<!doctype HTML>
<!--
Runs an acquire(), times out without ever connecting the element.
-->
<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: 100 }).then(() => {
setTimeout(() => {
document.body.appendChild(container);
finishTest("PASS if container is visible");
}, 200);
});
}
window.onload = runTest;
</script>