Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /eventsource/format-bom-split.any.html - WPT Dashboard Interop Dashboard
- /eventsource/format-bom-split.any.worker.html - WPT Dashboard Interop Dashboard
// META: title=EventSource: byte order mark split across chunks
async_test(t => {
// A byte order mark split after its first byte, then "data:1\n\ndata:2\n\n".
// If the byte order mark is not stripped, the first line's field name is
// "\ufeffdata" and the first message is "2".
const source = new EventSource("/xhr/resources/content-in-chunks.py?type=text/event-stream" +
"&chunk=ef&chunk=bbbf646174613a310a0a646174613a320a0a");
t.add_cleanup(() => source.close());
source.onmessage = t.step_func_done(event => {
assert_equals(event.data, "1");
});
}, "EventSource: byte order mark split across chunks");