From 4c79b9eb37ad686d1c21e22edc5de1c48d6d615c Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 17 May 2017 09:46:16 +0200 Subject: [PATCH] BroadcastChannel: origin of events For https://github.com/whatwg/html/pull/2689. --- webmessaging/broadcastchannel/origin.window.js | 10 ++++++++++ webmessaging/broadcastchannel/resources/origin.html | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 webmessaging/broadcastchannel/origin.window.js create mode 100644 webmessaging/broadcastchannel/resources/origin.html diff --git a/webmessaging/broadcastchannel/origin.window.js b/webmessaging/broadcastchannel/origin.window.js new file mode 100644 index 00000000000000..7e9d602af194b7 --- /dev/null +++ b/webmessaging/broadcastchannel/origin.window.js @@ -0,0 +1,10 @@ +async_test(t => { + const crossOriginURL = new URL("resources/origin.html", self.location.href).href.replace("://", "://天気の良い日."), + frame = document.createElement("iframe"); + frame.src = crossOriginURL; + document.body.appendChild(frame); + t.add_cleanup(() => frame.remove()); + self.onmessage = t.step_func_done(e => { + assert_equals(e.data, self.origin.replace("://", "://xn--n8j6ds53lwwkrqhv28a.")); + }); +}, "Serialization of BroadcastChannel origin"); diff --git a/webmessaging/broadcastchannel/resources/origin.html b/webmessaging/broadcastchannel/resources/origin.html new file mode 100644 index 00000000000000..f57d582bbb878c --- /dev/null +++ b/webmessaging/broadcastchannel/resources/origin.html @@ -0,0 +1,8 @@ +