format-data-before-final-empty-line.any.js (616B)
1 // META: title=EventSource: a data before final empty line 2 3 var test = async_test() 4 test.step(function() { 5 var source = new EventSource("resources/message.py?newline=none&message=" + encodeURIComponent("retry:1000\ndata:test1\n\nid:test\ndata:test2")) 6 var count = 0; 7 source.onmessage = function(e) { 8 if (++count === 2) { 9 test.step(function() { 10 assert_equals(e.lastEventId, "", "lastEventId") 11 assert_equals(e.data, "test1", "data") 12 source.close() 13 }) 14 test.done() 15 } 16 } 17 })