blob: 8bb6fc250133cb6b24b22c0d283a97d6d09150cd [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test.js"></script>
<script>
description("Basic testing for DeviceOrientationEvent.requestPermission().");
jsTestIsAsync = true;
if (window.testRunner)
testRunner.setShouldAllowDeviceOrientationAndMotionAccess(true);
addEventListener("deviceorientation", () => {});
internals.withUserGesture(() => {
DeviceOrientationEvent.requestPermission().then((_result) => {
result = _result;
shouldBeEqualToString("result", "granted");
addEventListener("deviceorientation", () => {});
DeviceOrientationEvent.requestPermission().then((_result) => {
result = _result;
shouldBeEqualToString("result", "granted");
finishJSTest();
});
});
});
</script>
</body>
</html>