discovery-succeeds.https.window.js (962B)
1 // META: script=/resources/testdriver.js?feature=bidi 2 // META: script=/resources/testdriver-vendor.js 3 // META: script=/bluetooth/resources/bluetooth-test.js 4 // META: script=/bluetooth/resources/bluetooth-fake-devices.js 5 // META: timeout=long 6 'use strict'; 7 const test_desc = 'Discover a device using alias, name, or UUID.'; 8 9 const test_specs = [ 10 { 11 filters: [{services: [health_thermometer.alias]}], 12 }, 13 { 14 filters: [{services: [health_thermometer.name]}], 15 }, 16 { 17 filters: [{services: [health_thermometer.uuid]}], 18 }, 19 ]; 20 21 bluetooth_bidi_test( 22 () => setUpHealthThermometerDevice().then(() => { 23 let test_promises = Promise.resolve(); 24 test_specs.forEach(args => { 25 test_promises = test_promises.then(async () => { 26 const device = await requestDeviceWithTrustedClick(args); 27 assert_equals(device.constructor.name, 'BluetoothDevice'); 28 }); 29 }); 30 return test_promises; 31 }), 32 test_desc);