Skip to content

Commit

Permalink
Improve robustness of wpt /pointerlock/mouse_buttons_back_forward.htm…
Browse files Browse the repository at this point in the history
…l test

Differential Revision: https://phabricator.services.mozilla.com/D91209

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1666400
gecko-commit: 36ec612760595d360c0a79762e17c9de85cce317
gecko-reviewers: smaug
  • Loading branch information
EdgarChen authored and moz-wptsync-bot committed Sep 24, 2020
1 parent c9af305 commit c619cd5
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions pointerlock/mouse_buttons_back_forward.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,28 @@
}
});

document.addEventListener("pointerlockchange", function() {
assert_equals(document.pointerLockElement, document.body);

// Inject mouse input
var actions = new test_driver.Actions();
actions.pointerMove(1, 1)
.pointerDown({button: actions.ButtonType.BACK})
.pointerUp({button: actions.ButtonType.BACK})
.pointerDown({button: actions.ButtonType.FORWARD})
.pointerUp({button: actions.ButtonType.FORWARD})
.send();
}, { once: true });

document.addEventListener("pointerlockerror", function() {
assert_unreached("Pointer lock error");
});

// Inject mouse input
var actions = new test_driver.Actions();
actions.pointerMove(1, 1)
.pointerDown({button: actions.ButtonType.LEFT})
.pointerUp({button: actions.ButtonType.LEFT})
.pointerDown({button: actions.ButtonType.BACK})
.pointerUp({button: actions.ButtonType.BACK})
.pointerDown({button: actions.ButtonType.FORWARD})
.pointerUp({button: actions.ButtonType.FORWARD})
.send();
</script>

Expand Down

0 comments on commit c619cd5

Please sign in to comment.