diff --git a/remote/webdriver-bidi/modules/root/browsingContext.sys.mjs b/remote/webdriver-bidi/modules/root/browsingContext.sys.mjs index d1e8158bb780..f07d228b38ff 100644 --- a/remote/webdriver-bidi/modules/root/browsingContext.sys.mjs +++ b/remote/webdriver-bidi/modules/root/browsingContext.sys.mjs @@ -1495,6 +1495,12 @@ class BrowsingContextModule extends RootBiDiModule { const context = this.#getBrowsingContext(contextId); + if (context.parent) { + throw new lazy.error.InvalidArgumentError( + `Browsing Context with id ${contextId} is not top-level` + ); + } + lazy.assert.integer( delta, lazy.pprint`Expected "delta" to be an integer, got ${delta}` diff --git a/testing/web-platform/meta/webdriver/tests/bidi/browsing_context/traverse_history/invalid.py.ini b/testing/web-platform/meta/webdriver/tests/bidi/browsing_context/traverse_history/invalid.py.ini index 4f39fd571603..b7325449c3f9 100644 --- a/testing/web-platform/meta/webdriver/tests/bidi/browsing_context/traverse_history/invalid.py.ini +++ b/testing/web-platform/meta/webdriver/tests/bidi/browsing_context/traverse_history/invalid.py.ini @@ -1,5 +1,3 @@ [invalid.py] disabled: if (os == "android") and not fission: bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1865124 - [test_iframe] - expected: FAIL