mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
Bug 1528058 [wpt PR 15378] - [Screen Orientation] Fix: add requestFullscreen to lock-basic, a=testonly
Automatic update from web-platform-tests [Screen Orientation] Fix: add requestFullscreen to lock-basic (#15378) -- wpt-commits: 0f05661c8e441416e314cc6c5779671d29c81a09 wpt-pr: 15378
This commit is contained in:
parent
e6279182b9
commit
ea19a50c17
@ -1,6 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
screen.orientation.unlock();
|
||||
@ -12,11 +14,18 @@ test(() => {
|
||||
}, "Test that screen.orientation.unlock() returns a void value");
|
||||
|
||||
promise_test(async t => {
|
||||
await test_driver.bless("request full screen", () => {
|
||||
return document.documentElement.requestFullscreen();
|
||||
});
|
||||
const value = await screen.orientation.lock('any');
|
||||
assert_equals(value, undefined);
|
||||
return document.exitFullscreen();
|
||||
}, "Test that screen.orientation.lock returns a promise which will be fulfilled with a void value.");
|
||||
|
||||
promise_test(async t => {
|
||||
await test_driver.bless("request full screen", () => {
|
||||
return document.documentElement.requestFullscreen();
|
||||
});
|
||||
const orientations = [
|
||||
'any',
|
||||
'natural',
|
||||
@ -50,9 +59,13 @@ promise_test(async t => {
|
||||
}
|
||||
}
|
||||
screen.orientation.unlock();
|
||||
return document.exitFullscreen();
|
||||
}, "Test that screen.orientation.lock returns a pending promise.");
|
||||
|
||||
promise_test(async t => {
|
||||
await test_driver.bless("request full screen", () => {
|
||||
return document.documentElement.requestFullscreen();
|
||||
});
|
||||
const preType = screen.orientation.type;
|
||||
const isPortrait = preType.includes("portrait");
|
||||
const newType = `${ isPortrait ? "landscape" : "portrait" }-primary`;
|
||||
@ -60,5 +73,6 @@ promise_test(async t => {
|
||||
assert_equals(screen.orientation.type, preType, "Must not change orientation until next spin of event loop");
|
||||
await p;
|
||||
assert_equals(screen.orientation.type, newType);
|
||||
return document.exitFullscreen();
|
||||
}, "Test that screen.orientation.lock() is actually async");
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user