diff --git a/remote/webdriver-bidi/modules/root/script.jsm b/remote/webdriver-bidi/modules/root/script.jsm index 438b3c4ce5ac..c09fd8839d84 100644 --- a/remote/webdriver-bidi/modules/root/script.jsm +++ b/remote/webdriver-bidi/modules/root/script.jsm @@ -249,10 +249,16 @@ class ScriptModule extends Module { ); } + if (!context.currentWindowGlobal) { + throw new lazy.error.NoSuchFrameError( + `No window found for BrowsingContext with id ${contextId}` + ); + } + // TODO: Return an actual realm once we have proper realm support. // See Bug 1766240. return { - realm: null, + realm: String(context.currentWindowGlobal.innerWindowId), origin: null, type: RealmType.Window, context, diff --git a/testing/web-platform/meta/webdriver/tests/bidi/script/evaluate/evaluate.py.ini b/testing/web-platform/meta/webdriver/tests/bidi/script/evaluate/evaluate.py.ini index a34f227e635f..647c59261793 100644 --- a/testing/web-platform/meta/webdriver/tests/bidi/script/evaluate/evaluate.py.ini +++ b/testing/web-platform/meta/webdriver/tests/bidi/script/evaluate/evaluate.py.ini @@ -10,6 +10,3 @@ [test_rejected_promise_with_await_promise_false] expected: FAIL - - [test_rejected_promise_with_await_promise_true] - expected: FAIL