Files
tubestation/testing/web-platform/tests/eventsource/event-data.any.js
MierenManz aaf8143725 Bug 1722042 [wpt PR 29765] - EventSource: Convert some htm tests to JS, a=testonly
Automatic update from web-platform-tests
EventSource: use .any.js and .window.js more

--

wpt-commits: 00e8611b23fed04f014e882c12980cafc77e2c1b
wpt-pr: 29765
2021-09-21 14:20:36 +00:00

22 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++;
});
});