michael@0: /** michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: const importURL = "relativeLoad_import.js"; michael@0: michael@0: onmessage = function(event) { michael@0: var xhr = new XMLHttpRequest(); michael@0: xhr.open("GET", "testXHR.txt", false); michael@0: xhr.send(null); michael@0: if (xhr.status != 200 || michael@0: xhr.responseText != "A noisy noise annoys an oyster.") { michael@0: throw "Couldn't get xhr text from where we wanted it!"; michael@0: } michael@0: michael@0: importScripts(importURL); michael@0: var worker = new Worker("relativeLoad_worker2.js"); michael@0: worker.onerror = function(event) { michael@0: throw event.message; michael@0: }; michael@0: worker.onmessage = function(event) { michael@0: if (event.data != workerURL) { michael@0: throw "Bad data!"; michael@0: } michael@0: postMessage(workerURL); michael@0: } michael@0: };