| <script src="../../resources/js-test.js"></script> |
| testRunner.waitUntilDone(); |
| function buildInlineSharedWorker() { |
| var script = document.getElementById('workerCode').innerText; |
| var blob = new Blob([script], {type: 'text/javascript'}); |
| var worker = new SharedWorker(URL.createObjectURL(blob)); |
| worker.port.postMessage({cmd: 'connect', id: "host"}); |
| worker.port.addEventListener('message', function (e) { |
| setTimeout(finishJSTest, 0); |
| <!-- This script's body will be used to build a Blob URL to use as a Worker. --> |
| <script id="workerCode" type="text/plain"> |
| console.log(typeof console.log); |
| console.log(console.log.toString()); |
| // FIXME(slightlyoff): these aren't getting logged properly from here! |
| console.markTimeline("markTimeline"); |
| self.addEventListener("connect", function (e) { |
| port.postMessage({ done: true }); |
| window.jsTestIsAsync = true; |
| description("This tests that 'console.log' and friends function correctly from workers."); |
| buildInlineSharedWorker(); |