format-mime-bogus.any.js (823B)
1 // META: title=EventSource: bogus MIME type 2 var test = async_test() 3 test.step(function() { 4 var source = new EventSource("resources/message.py?mime=x%20bogus") 5 source.onmessage = function() { 6 test.step(function() { 7 assert_unreached() 8 source.close() 9 }) 10 test.done() 11 } 12 source.onerror = function(e) { 13 test.step(function() { 14 assert_equals(this.readyState, this.CLOSED) 15 assert_false(e.hasOwnProperty('data')) 16 assert_false(e.bubbles) 17 assert_false(e.cancelable) 18 this.close() 19 }, this) 20 test.done() 21 } 22 }) 23 // This tests "fails the connection" as well as making sure a simple 24 // event is dispatched and not a MessageEvent