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