From 4e86467751f9d30f7cb5dc47a511f2e586eacfa0 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 11:31:53 +0200 Subject: [PATCH] test: add response to bluetooth request possibilities (#47744) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- spec/chromium-spec.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index 90cfe8c8b92e..da0a183d1e7b 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -3637,8 +3637,14 @@ describe('navigator.bluetooth', () => { it('can request bluetooth devices', async () => { const bluetooth = await w.webContents.executeJavaScript(` - navigator.bluetooth.requestDevice({ acceptAllDevices: true}).then(device => "Found a device!").catch(err => err.message);`, true); - expect(bluetooth).to.be.oneOf(['Found a device!', 'Bluetooth adapter not available.', 'User cancelled the requestDevice() chooser.']); + navigator.bluetooth.requestDevice({ acceptAllDevices: true }).then(device => "Found a device!").catch(err => err.message);`, true); + const requestResponses = [ + 'Found a device!', + 'Bluetooth adapter not available.', + 'User cancelled the requestDevice() chooser.', + 'User denied the browser permission to scan for Bluetooth devices.' + ]; + expect(bluetooth).to.be.oneOf(requestResponses, `Unexpected response: ${bluetooth}`); }); }); @@ -3668,6 +3674,7 @@ describe('navigator.hid', () => { server.close(); closeAllWindows(); }); + afterEach(() => { session.defaultSession.setPermissionCheckHandler(null); session.defaultSession.setDevicePermissionHandler(null);