https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 1d80ed8c6e3c70dc91ecdc3942cf736c974e2490 authored by Behind The Math on 05 April 2018, 03:02:14 UTC
Add tests to check that the User-Agent header is set for XHR requests
Tip revision: 1d80ed8
pointerlock_remove_target_on_mouseup-manual.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Remove PointerLock target on mouseup</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<p>Click anywhere to run the test. If a "PASS" result appears the test passes, otherwise it fails</p>
<div id="target"></div>
<script>
async_test(t => {
    const target = document.getElementById('target');
    document.addEventListener('mousedown', t.step_func(() => {
        target.requestPointerLock();
        document.addEventListener('mouseup', t.step_func(() => {
            target.remove();
            assert_true(document.pointerLockElement === null, 'Pointer lock exited!');
            t.done();
        }));
    }));
})
</script>
back to top