From dd4751d8bd4b9949a34cf568f20a5185d195c524 Mon Sep 17 00:00:00 2001 From: Maksim Sadym <69349599+sadym-chromium@users.noreply.github.com> Date: Tue, 28 Jan 2025 11:48:49 +0100 Subject: [PATCH] fix: allow `bluetooth.requestDevicePromptUpdated` subscription (#3044) The specific event name was missing in the `EVENT_NAMES`, which made it impossible to subscribe to a specific event. --- src/protocol/chromium-bidi.ts | 1 + tests/bluetooth/test_handle_prompt.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/protocol/chromium-bidi.ts b/src/protocol/chromium-bidi.ts index 788b5db2bd..bf8483451b 100644 --- a/src/protocol/chromium-bidi.ts +++ b/src/protocol/chromium-bidi.ts @@ -142,6 +142,7 @@ export type Event = WebDriverBidi.Event | Cdp.Event | BluetoothEvent; export const EVENT_NAMES = new Set([ // keep-sorted start ...Object.values(BiDiModule), + ...Object.values(Bluetooth.EventNames), ...Object.values(BrowsingContext.EventNames), ...Object.values(Log.EventNames), ...Object.values(Network.EventNames), diff --git a/tests/bluetooth/test_handle_prompt.py b/tests/bluetooth/test_handle_prompt.py index 9bc2ff3754..d11cb1dda5 100644 --- a/tests/bluetooth/test_handle_prompt.py +++ b/tests/bluetooth/test_handle_prompt.py @@ -74,7 +74,7 @@ async def test_bluetooth_requestDevicePromptUpdated(websocket, context_id, if test_headless_mode == "old": pytest.xfail("Old headless mode does not support Bluetooth") - await subscribe(websocket, ['bluetooth']) + await subscribe(websocket, ['bluetooth.requestDevicePromptUpdated']) url = html(HTML_SINGLE_PERIPHERAL) await goto_url(websocket, context_id, url)