https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 8aa53dd361f53703c6c67c4b007a472832a855a2 authored by Marcos Cáceres on 22 November 2018, 02:14:30 UTC
fix: copy pasta
Tip revision: 8aa53dd
not-processing-user-gesture.https.html
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/bluetooth/resources/bluetooth-helpers.js"></script>
<script>
'use strict';
const test_desc = 'Requires a user gesture.';
const expected = new DOMException(
    'Must be handling a user gesture to show a permission request.',
    'SecurityError');

bluetooth_test(() => setUpHealthThermometerAndHeartRateDevices()
    .then(() => assert_promise_rejects_with_message(
        navigator.bluetooth.requestDevice({filters:[{services:['heart_rate']}]}),
        expected, 'User gesture is required')),
    test_desc);
</script>
back to top