Bug 1534117 [wpt PR 15705] - Screen Orientation: active lock orientation algorithm tests, a=testonly

Automatic update from web-platform-tests
Active lock orientation algorithm tests

--
Fragment navigation test

--
Refactoring

--
Suggested edits

--
Add element that represents the actual fragment
--

wpt-commits: 6b4f997ddf44dfa8de0ebc32efce8bf96c87ba8c, 2efa6123606550ceb0d42151640efa8a80b3533b, 186650ff075e14ffdc8b6be4c5fa9156add7e243, de041de96601e556b6788815511fc60f8b220745, e9cad1bbdac87dc162fb662d5dca0f2cf734b831
wpt-pr: 15705
This commit is contained in:
Johanna-hub 2019-04-18 11:17:12 +00:00 коммит произвёл James Graham
Родитель fc858f251f
Коммит 5afa428d5f
1 изменённых файлов: 25 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,25 @@
<!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>
<p id="#fragment"></p>
<script>
promise_test(async t => {
await test_driver.bless("request full screen", () => {
return document.documentElement.requestFullscreen();
});
const fragment = document.createElement("p");
fragment.id = "fragment";
document.body.appendChild(fragment);
const { type: preType } = screen.orientation;
const isPortrait = preType.startsWith("portrait");
const newType = `${isPortrait ? "landscape" : "portrait"}-primary`;
const p = screen.orientation.lock(newType);
screen.orientation.onchange = t.unreached_func(
"change event must not fire"
);
window.location.href = "#fragment";
await p;
}, "When performing a fragment navigation, the orientation must not change or unlock");
</script>