summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/bluetooth/requestDevice/doesnt-consume-user-gesture.https.window.js
blob: 9c742733e1d793d9becda42d8afd245f7c9b633d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js
// META: script=/bluetooth/resources/bluetooth-test.js
// META: script=/bluetooth/resources/bluetooth-fake-devices.js
'use strict';
const test_desc = 'requestDevice calls do not consume user gestures.';

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')),
            second.then(
                device =>
                    assert_equals(device.constructor.name, 'BluetoothDevice')),
          ]);
        })),
    test_desc);