optional-services-missing.https.window.js (871B)
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 = 'requestDevice called with acceptAllDevices: true and ' + 8 'with no optionalServices. Should not get access to any services.'; 9 const expected = new DOMException( 10 'Origin is not allowed to access any service. ' + 11 'Tip: Add the service UUID to \'optionalServices\' in ' + 12 'requestDevice() options. https://goo.gl/HxfxSQ', 13 'SecurityError'); 14 15 bluetooth_bidi_test(async () => { 16 let {device} = 17 await getConnectedHealthThermometerDevice({acceptAllDevices: true}); 18 assert_promise_rejects_with_message( 19 device.gatt.getPrimaryServices(), expected); 20 }, test_desc);