Bug 1776738: Make fullscreen and pointerlock mochitests use document.fullscreenElemen...
commita9a7928a800f767cf601576ab35788380db04a6d
authorBrad Werth <bwerth@mozilla.com>
Tue, 21 Mar 2023 23:07:38 +0000 (21 23:07 +0000)
committerBrad Werth <bwerth@mozilla.com>
Tue, 21 Mar 2023 23:07:38 +0000 (21 23:07 +0000)
tree50aef1d52e1f7829a4ba0151d447469522809685
parenta12fefb858ec369ed8c21aabce2a03eee25f185c
Bug 1776738: Make fullscreen and pointerlock mochitests use document.fullscreenElement to determine fullscreen-ness. r=edgar

With these changes, it's no longer necessary to store the normalSize on
the window, since we never check it, nor check for resize events. This
also removes the flaky timeouts, and replaces them with an executeSoon.

For some of the fullscreen tests, the number of calls to enter and exit
fullscreen are not matched. Since that count is essential for the checks
of whether or not the screen is in the expected fullscreen, this defines a
method that can force the count to a specific value. This is used in some
of the fullscreen tests to get the expected results.

Differential Revision: https://phabricator.services.mozilla.com/D172852
dom/base/test/fullscreen/file_fullscreen-denied.html
dom/base/test/fullscreen/file_fullscreen-multiple-inner.html
dom/base/test/fullscreen/file_fullscreen-multiple.html
dom/base/test/fullscreen/file_fullscreen-nested.html
dom/base/test/fullscreen/file_fullscreen-rollback.html
dom/base/test/fullscreen/file_fullscreen-scrollbar.html
dom/base/test/fullscreen/file_fullscreen-selector.html
dom/base/test/fullscreen/file_fullscreen-utils.js
dom/tests/mochitest/pointerlock/pointerlock_utils.js