From bbe0a46e8974b6799237ea4349ec16b7096be8a3 Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Thu, 6 Apr 2023 14:49:49 +0000 Subject: [PATCH] Bug 1826706 - [bidi] Throw a NoSuchFrameError in input.performActions if no context is found r=webdriver-reviewers,whimboo Per spec, we should throw if the provided context is not found. Differential Revision: https://phabricator.services.mozilla.com/D174847 --- remote/webdriver-bidi/modules/root/input.sys.mjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/remote/webdriver-bidi/modules/root/input.sys.mjs b/remote/webdriver-bidi/modules/root/input.sys.mjs index a84f2aa6d46e..6a58d7611df2 100644 --- a/remote/webdriver-bidi/modules/root/input.sys.mjs +++ b/remote/webdriver-bidi/modules/root/input.sys.mjs @@ -27,6 +27,13 @@ class InputModule extends Module { ); const context = lazy.TabManager.getBrowsingContextById(contextId); + if (!context) { + throw new lazy.error.NoSuchFrameError( + `Browsing context with id ${contextId} not found` + ); + } + + // Bug 1821460: Fetch top-level browsing context. await this.messageHandler.forwardCommand({ moduleName: "input",