format-mime-valid-bogus.any.js (810B)
1 // META: title=EventSource: incorrect valid MIME type 2 var test = async_test() 3 test.step(function() { 4 var source = new EventSource("resources/message.py?mime=text/x-bogus") 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(source.readyState, source.CLOSED) 15 assert_false(e.hasOwnProperty('data')) 16 assert_false(e.bubbles) 17 assert_false(e.cancelable) 18 }) 19 test.done() 20 } 21 }) 22 // This tests "fails the connection" as well as making sure a simple 23 // event is dispatched and not a MessageEvent