Skip to content

Commit

Permalink
[PointerLock] Add null check before dispatching click event
Browse files Browse the repository at this point in the history
BUG=706802

Review-Url: https://codereview.chromium.org/2846993002
Cr-Commit-Position: refs/heads/master@{#469510}
  • Loading branch information
chongz authored and chromium-wpt-export-bot committed May 5, 2017
1 parent f94efaa commit adc02b4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pointerlock/pointerlock_remove_target_on_mouseup-manual.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!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>

0 comments on commit adc02b4

Please sign in to comment.