| <!-- webkit-test-runner [ SiteIsolationEnabled=true ] --> |
| |
| <script src="/js-test-resources/js-test.js"></script> |
| <script> |
| if (window.testRunner) |
| testRunner.waitUntilDone(); |
| |
| window.addEventListener('message', (event) => { |
| if (event.data.type === 'pointerLockChanged') { |
| console.log('Iframe pointer lock changed:', event.data.locked); |
| |
| // Verify site isolation - parent should NOT have pointer lock |
| const parentLocked = document.pointerLockElement !== null; |
| console.log('Parent document locked:', parentLocked); |
| |
| if (event.data.locked && !parentLocked) |
| console.log('Site isolation working correctly'); |
| |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| } |
| }); |
| |
| // Pointer lock not supported on iOS |
| const hasPointerLock = 'pointerLockElement' in document; |
| if (!hasPointerLock) { |
| console.log("Pointerlock not supported"); |
| |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| } |
| </script> |
| |
| <body> |
| <iframe src="http://localhost:8000/site-isolation/resources/pointer-lock.html" /> |
| </body> |