| Domenic Denicola | 1a6c18c | 2016-11-01 10:24:10 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <meta charset="utf-8"> |
| 3 | <title>EventSource: message event Realm</title> |
| 4 | <link rel="help" href="https://html.spec.whatwg.org/multipage/comms.html#dispatchMessage"> |
| 5 | <script src="/resources/testharness.js"></script> |
| 6 | <script src="/resources/testharnessreport.js"></script> |
| 7 | |
| 8 | <iframe src="eventsource-onmessage-realm-support.htm"></iframe> |
| 9 | |
| 10 | <script> |
| 11 | "use strict"; |
| 12 | |
| 13 | async_test(t => { |
| 14 | window.onload = t.step_func(() => { |
| 15 | const source = new frames[0].EventSource("resources/message.py"); |
| 16 | t.add_cleanup(() => { |
| 17 | source.close(); |
| 18 | }); |
| 19 | |
| 20 | source.onmessage = t.step_func_done(e => { |
| 21 | assert_equals(e.constructor, frames[0].MessageEvent); |
| 22 | }); |
| 23 | }); |
| 24 | }, "the MessageEvent must be created in the Realm of the EventSource"); |
| 25 | </script> |