mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-09 21:00:42 +02:00
Automatic update from web-platform-testsSupport promises for fullscreen API. Add ability to store the promises in the pending requests and exits. Adjust tests to ensure they work correctly with promises. BUG=383813 Change-Id: I81e4780d5ea25b3a1ac7fef54b1fbc9c0d31897a Reviewed-on: https://chromium-review.googlesource.com/1075711 Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Philip Jägenstedt <foolip@chromium.org> Cr-Commit-Position: refs/heads/master@{#562946} -- wpt-commits: 0fae4aa0c51c6193ef1b2b74a61352b832d95cfa wpt-pr: 11207
29 lines
925 B
HTML
29 lines
925 B
HTML
<!DOCTYPE html>
|
|
<title>Element#requestFullscreen() when not allowed to request fullscreen</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<div id="log"></div>
|
|
<script>
|
|
async_test(t => {
|
|
const div = document.querySelector("div");
|
|
var promise_executed = false;
|
|
|
|
document.addEventListener("fullscreenerror", t.step_func_done(event => {
|
|
assert_equals(event.target, div, "event.target");
|
|
assert_true(event.bubbles, "event.bubbles");
|
|
assert_false(event.cancelable, "event.cancelable");
|
|
assert_true(event.composed, "event.composed");
|
|
assert_true(promise_executed, "promise executed");
|
|
}));
|
|
|
|
var promise = div.requestFullscreen();
|
|
if (promise) {
|
|
promise.catch(()=> {
|
|
promise_executed = true;
|
|
});
|
|
} else {
|
|
// If promises aren't supported just treat it as already done.
|
|
promise_executed = true;
|
|
}
|
|
});
|
|
</script>
|