eventsource-url.htm (691B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>shared worker - EventSource: url</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 test.step(function() { 13 var url = "resources/message.py" 14 var worker = new SharedWorker('eventsource-url.js') 15 worker.port.onmessage = function(e) { 16 test.step(function() { 17 assert_true(e.data[0], e.data[1]); 18 assert_equals(e.data[1].substr(-(url.length)), url) 19 }) 20 test.done() 21 } 22 }) 23 </script> 24 </body> 25 </html>