summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/permissions-policy/resources/permissions-policy-battery.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/permissions-policy/resources/permissions-policy-battery.html')
-rw-r--r--testing/web-platform/tests/permissions-policy/resources/permissions-policy-battery.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/testing/web-platform/tests/permissions-policy/resources/permissions-policy-battery.html b/testing/web-platform/tests/permissions-policy/resources/permissions-policy-battery.html
new file mode 100644
index 0000000000..643d6a4ef5
--- /dev/null
+++ b/testing/web-platform/tests/permissions-policy/resources/permissions-policy-battery.html
@@ -0,0 +1,9 @@
+<script>
+'use strict';
+
+Promise.resolve().then(() => navigator.getBattery()).then(battery => {
+ window.parent.postMessage({ type: 'availability-result', enabled: true }, '*');
+}, error => {
+ window.parent.postMessage({ type: 'availability-result', enabled: false }, '*');
+});
+</script>