eventsource-constructor-stringify.window.js (945B)
1 // META: title=EventSource: stringify argument 2 3 async_test(function (test) { 4 test.step(function() { 5 var source = new EventSource({toString:function(){return "resources/message.py";}}) 6 source.onopen = function(e) { 7 test.step(function() { 8 assert_false(e.hasOwnProperty('data')) 9 source.close() 10 test.done() 11 }) 12 } 13 }); 14 }, document.title + ', object'); 15 16 test(function(){ 17 var source = new EventSource(1); 18 assert_regexp_match(source.url, /\/1$/); 19 }, document.title + ', 1'); 20 test(function(){ 21 var source = new EventSource(null); 22 assert_regexp_match(source.url, /\/null$/); 23 }, document.title + ', null'); 24 test(function(){ 25 var source = new EventSource(undefined); 26 assert_regexp_match(source.url, /\/undefined$/); 27 }, document.title + ', undefined');