1
0
Fork 0
firefox/testing/web-platform/tests/eventsource/event-data.any.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

21 lines
641 B
JavaScript

// META: title=EventSource: lines and data parsing
var test = async_test();
test.step(function() {
var source = new EventSource("resources/message2.py"),
counter = 0;
source.onmessage = test.step_func(function(e) {
if(counter == 0) {
assert_equals(e.data,"msg\nmsg");
} else if(counter == 1) {
assert_equals(e.data,"");
} else if(counter == 2) {
assert_equals(e.data,"end");
source.close();
test.done();
} else {
assert_unreached();
}
counter++;
});
});