| <!doctype HTML> |
| |
| <!-- |
| Runs an acquireDisplayLock on an element that doesn't have containment. |
| This rejects the promise. |
| --> |
| |
| <div id="log"></div> |
| |
| <script> |
| 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 acquire() { |
| let container = document.createElement("div"); |
| container.acquireDisplayLock((context) => {}).then( |
| () => { finishTest("FAIL"); }, |
| () => { finishTest("PASS"); }); |
| document.body.appendChild(container); |
| } |
| |
| window.onload = acquire; |
| </script> |
| |