https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 093b9474d12dc945dccdff7cc35ace71b60c9978 authored by moz-wptsync-bot on 13 March 2018, 19:14:12 UTC
Add a WPT test for calc font-variation-settings.
Tip revision: 093b947
consumes-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 = 'Consumes a user gesture.';
const expected = new DOMException(
    'Must be handling a user gesture to show a permission request.',
    'SecurityError');

bluetooth_test(() => setUpHealthThermometerAndHeartRateDevices()
    .then(() => callWithTrustedClick(() => {
      let first = navigator.bluetooth.requestDevice({
        filters: [{services: ['heart_rate']}]});
      let second = navigator.bluetooth.requestDevice({
        filters: [{services: ['heart_rate']}]});
      return Promise.all([
        first.then(device => assert_equals(
          device.constructor.name, 'BluetoothDevice')),
        assert_promise_rejects_with_message(second,
          expected, 'A request should consume a user gesture')
      ]);
    })), test_desc);
</script>
back to top