| <!doctype HTML> |
| |
| <!-- |
| Ensures page is clean, runs an acquire after a delay. |
| --> |
| |
| <style> |
| #container { |
| contain: style layout; |
| width: 150px; |
| height: 150px; |
| background: lightblue; |
| } |
| #checker { |
| width: 50px; |
| height: 50px; |
| background: green; |
| } |
| </style> |
| |
| <div id="container"></div> |
| <div id="checker"></div> |
| |
| <script> |
| // TODO(vmpstr): In WPT this needs to be replaced with reftest-wait. |
| if (window.testRunner) |
| window.testRunner.waitUntilDone(); |
| |
| function finishTest() { |
| if (window.testRunner) |
| window.testRunner.notifyDone(); |
| } |
| |
| function runTest() { |
| let container = document.getElementById("container"); |
| container.getDisplayLock().acquire({ timeout: Infinity }).then(() => { |
| finishTest(); |
| }); |
| } |
| |
| window.onload = () => { |
| requestAnimationFrame(() => requestAnimationFrame(runTest)); |
| }; |
| </script> |