Add support for Device Orientation / Motion permission API
[WebKit-https.git] / LayoutTests / fast / device-orientation / device-motion-request-permission-user-gesture.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/js-test.js"></script>
5 <script>
6 description("Tests that DeviceMotionEvent.requestPermission() requires a user gesture.");
7 jsTestIsAsync = true;
8
9
10 DeviceMotionEvent.requestPermission().then((result) => {
11     testFailed("requestPermission promise was not rejected");
12 }, (_e) => {
13     e = _e;
14     console.log(e);
15     shouldBeEqualToString("e.name", "NotAllowedError");
16     finishJSTest();
17 });
18 </script>
19 </body>
20 </html>