summaryrefslogtreecommitdiffstats
path: root/dom/base/test/file_lock_orientation_with_pending_fullscreen.html
blob: 07af0fc67dd19c08e974c8472570070f5e1df531 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
</head>
<script>
const ok = window.parent.ok;
const SpecialPowers = window.parent.SpecialPowers;

async function runTest() {
  SpecialPowers.wrap(document.documentElement).requestFullscreen();
  const currentType = window.screen.orientation.type;
  const lockPromise = window.screen.orientation.lock(currentType.startsWith("landscape") ? "portrait" : "landscape");
  ok(true, "lock orientation doesn't throw error at this time");
  // This document will be detached by "pending" message.
  parent.postMessage("pending", "*");
  await lockPromise;
}
</script>
<body onload="runTest()">
</body>
</html>