commit 004b7e9bcb90bd7fadabaa3fee0c47bc54e9e064 parent 04ac749b6dd7a925e41eeba2948d996869b62fd5 Author: Anne van Kesteren <annevk@annevk.nl> Date: Thu, 11 Dec 2025 09:27:50 +0000 Bug 2004995 [wpt PR 56599] - Origin API: constructed message events have no origin, a=testonly Automatic update from web-platform-tests Origin API: constructed message events have no origin For https://github.com/whatwg/html/issues/11993. -- wpt-commits: 367e3a47558414a9088fee7936eef24eea95b7b7 wpt-pr: 56599 Diffstat:
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/testing/web-platform/tests/html/browsers/origin/api/origin-from-extendablemessageevent.any.js b/testing/web-platform/tests/html/browsers/origin/api/origin-from-extendablemessageevent.any.js @@ -14,12 +14,8 @@ function WorkerActivationPromise() { test(t => { const e = new ExtendableMessageEvent("message", { origin: get_host_info().ORIGIN }); - const origin = Origin.from(e); - assert_true(!!origin, "It's not null!"); - assert_false(origin.opaque, "It's not opaque!"); - assert_true(origin.isSameOrigin(Origin.from(self)), "It's same-origin with an Origin!"); -}, "Constructed `ExtendableMessageEvent` objects have origins."); - + assert_throws_js(TypeError, _ => Origin.from(e)); +}, "Constructed `ExtendableMessageEvent` objects have no real origins."); promise_test(async t => { await WorkerActivationPromise(); diff --git a/testing/web-platform/tests/html/browsers/origin/api/origin-from-messageevent.window.js b/testing/web-platform/tests/html/browsers/origin/api/origin-from-messageevent.window.js @@ -1,6 +1,11 @@ // META: title=`Origin.from(MessageEvent)` // META: script=/common/get-host-info.sub.js +test(t => { + const e = new MessageEvent("message", { origin: get_host_info().ORIGIN }); + assert_throws_js(TypeError, _ => Origin.from(e)); +}, "Constructed `MessageEvent` objects have no real origins."); + async_test(t => { const el = document.createElement('iframe'); el.src = "/html/browsers/windows/resources/message-parent.html"