31 lines
782 B
HTML
31 lines
782 B
HTML
<!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(true);
|
|
|
|
addEventListener("devicemotion", () => {});
|
|
|
|
internals.withUserGesture(() => {
|
|
DeviceMotionEvent.requestPermission().then((_result) => {
|
|
result = _result;
|
|
shouldBeEqualToString("result", "granted");
|
|
|
|
addEventListener("devicemotion", () => {});
|
|
|
|
DeviceMotionEvent.requestPermission().then((_result) => {
|
|
result = _result;
|
|
shouldBeEqualToString("result", "granted");
|
|
finishJSTest();
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|