eventsource-constructor-url-multi-window.htm (1034B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>EventSource: resolving URLs</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 </head> 8 <body> 9 <div id="log"></div> 10 <script> 11 var test = async_test() 12 function init() { 13 test.step(function() { 14 source = new self[0].EventSource("message.py") 15 source.onopen = function(e) { 16 test.step(function() { 17 assert_equals(source.readyState, source.OPEN) 18 assert_false(e.hasOwnProperty('data')) 19 assert_false(e.bubbles) 20 assert_false(e.cancelable) 21 this.close() 22 test.done() 23 }, this) 24 } 25 source.onerror = function(e) { 26 test.step(function() { 27 assert_unreached() 28 source.close() 29 test.done() 30 }) 31 } 32 }) 33 } 34 </script> 35 <iframe src="resources/init.htm"></iframe> 36 </body> 37 </html>