| <!doctype HTML> |
| |
| <!-- |
| Runs acquire and commit on an element that doesn't have containment. |
| This rejects the promise. |
| --> |
| |
| <div id="log"></div> |
| |
| <script> |
| // TODO(vmpstr): This can be a testharness test. |
| 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(); |
| } |
| |
| async function acquire() { |
| let container = document.createElement("div"); |
| await container.getDisplayLock().acquire({ timeout: Infinity }); |
| document.body.appendChild(container); |
| container.getDisplayLock().commit().then( |
| () => { finishTest("FAIL"); }, |
| () => { finishTest("PASS"); }); |
| } |
| |
| window.onload = acquire; |
| </script> |
| |