blob: e348b10b100f329e107547d51ad2d650117b3ea9 [file] [log] [blame]
<!doctype HTML>
<div id="log"></div>
<iframe id="frame" srcdoc='
<style>
#container {
contain: style layout;
width: 100px;
height: 100px;
background: lightblue;
}
</style>
<div id="container"></div>
'></iframe>
<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.getElementById("frame").contentDocument.getElementById("container");
container.displayLock.acquire({ timeout: Infinity }).then(
() => { finishTest("PASS"); },
(e) => { finishTest("FAIL " + e.message); });
}
window.onload = runTest;
</script>