Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / files / workers / inline-worker-via-blob-url.html
blobebc965d7af4e30e65deee8810987ae4cfe79354e
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 function log(message)
7 document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
10 function runTest()
12 log("Test inline web worker via blob URL.");
13 var string = [
14 "onmessage = function(e) {",
15 " postMessage('Hello from worker');",
16 "};"
17 ].join('\n');
18 var blobURL = URL.createObjectURL(new Blob([string]));
19 var worker = new Worker(blobURL);
20 worker.onmessage = function(event) {
21 log(event.data);
22 log("DONE");
23 if (testRunner.notifyDone)
24 testRunner.notifyDone();
26 worker.postMessage("hi");
29 if (window.testRunner) {
30 testRunner.setAllowUniversalAccessFromFileURLs(false);
31 testRunner.setAllowFileAccessFromFileURLs(true);
32 testRunner.dumpAsText();
33 testRunner.waitUntilDone();
35 </script>
36 </head>
37 <body onload="runTest()">
38 <pre id='console'></pre>
39 </body>
40 </html>