summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/screen-orientation/resources/sandboxed-iframe-locking.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/screen-orientation/resources/sandboxed-iframe-locking.html')
-rw-r--r--testing/web-platform/tests/screen-orientation/resources/sandboxed-iframe-locking.html32
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/web-platform/tests/screen-orientation/resources/sandboxed-iframe-locking.html b/testing/web-platform/tests/screen-orientation/resources/sandboxed-iframe-locking.html
new file mode 100644
index 0000000000..436c67f5b5
--- /dev/null
+++ b/testing/web-platform/tests/screen-orientation/resources/sandboxed-iframe-locking.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<script>
+test_driver.set_test_context(parent);
+
+// At first, run simple unlock test without lock.
+screen.orientation?.unlock();
+
+test_driver.bless("request full screen", async () => {
+ const data = {};
+ try {
+ await document.documentElement.requestFullscreen();
+ await screen.orientation.lock("portrait")
+ data.result = "locked";
+ data.orientation = screen.orientation.type;
+ } catch (error) {
+ data.result = "errored";
+ data.name = error.name;
+ }
+
+ screen.orientation.unlock();
+ try {
+ await document.exitFullscreen();
+ } catch (error) {
+ data.result = "errored";
+ data.name = error.name;
+ }
+
+ parent.window.postMessage(data, "*");
+});
+</script>