format-bom.any.js (711B)
1 // META: title=EventSource: BOM 2 3 var test = async_test(), 4 hasbeenone = false, 5 hasbeentwo = false 6 test.step(function() { 7 var source = new EventSource("resources/message.py?message=%EF%BB%BFdata%3A1%0A%0A%EF%BB%BFdata%3A2%0A%0Adata%3A3") 8 source.addEventListener("message", listener, false) 9 }) 10 function listener(e) { 11 test.step(function() { 12 if(e.data == "1") 13 hasbeenone = true 14 if(e.data == "2") 15 hasbeentwo = true 16 if(e.data == "3") { 17 assert_true(hasbeenone) 18 assert_false(hasbeentwo) 19 this.close() 20 test.done() 21 } 22 }, this) 23 }