1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// 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 with empty manufacturerData. ' +
'Should reject with TypeError.';
const test_specs = [
{filters: [{manufacturerData: []}]},
{filters: [{manufacturerData: [], name: 'Name'}]},
{filters: [{manufacturerData: [], services: ['heart_rate']}]},
{filters: [{manufacturerData: [], name: 'Name', services: ['heart_rate']}]},
{filters: [{manufacturerData: []}], optionalServices: ['heart_rate']}, {
filters: [{manufacturerData: [], name: 'Name'}],
optionalServices: ['heart_rate']
},
{
filters: [{manufacturerData: [], services: ['heart_rate']}],
optionalServices: ['heart_rate']
},
{
filters: [{manufacturerData: [], name: 'Name', services: ['heart_rate']}],
optionalServices: ['heart_rate']
}
];
bluetooth_test((t) => {
let test_promises = Promise.resolve();
test_specs.forEach(args => {
test_promises = test_promises.then(
() => promise_rejects_js(
t, TypeError, requestDeviceWithTrustedClick(args)));
});
return test_promises;
}, test_desc);
|