OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 onconnect = function(e) { |
| 3 var xhr = new XMLHttpRequest(); |
| 4 var log = ''; |
| 5 var port = e.ports[0]; |
| 6 var postMessage = port.postMessage; |
| 7 xhr.onreadystatechange = function(e) { |
| 8 if (this.readyState == 4) { |
| 9 if (this.responseXML != null) |
| 10 log += 'responseXML was not null. '; |
| 11 if (this.responseText && this.responseText != '<x>foo</x>') |
| 12 log += 'responseText was ' + this.responseText + ', expected <x>foo</x>.
'; |
| 13 postMessage.call(port, log); |
| 14 } |
| 15 } |
| 16 xhr.open('GET', '001-1.xml', true); |
| 17 xhr.send(); |
| 18 } |
| 19 |
| 20 /* |
| 21 --> |
| 22 <!doctype html> |
| 23 <title>async XMLHttpRequest in shared worker</title> |
| 24 <script src="/resources/testharness.js"></script> |
| 25 <script src="/resources/testharnessreport.js"></script> |
| 26 <div id=log></div> |
| 27 <script> |
| 28 var t = async_test(); |
| 29 function runtest() { |
| 30 var worker = new SharedWorker('#', ''); |
| 31 worker.port.onmessage = this.step_func(function(e) { |
| 32 assert_equals(e.data, ''); |
| 33 this.done(); |
| 34 }); |
| 35 } |
| 36 </script> |
| 37 <iframe src=001-1.xml onload="t.step(runtest);"></iframe> |
| 38 <!-- |
| 39 */ |
| 40 //--> |
| 41 |
OLD | NEW |