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 importSubURL = "relativeLoad_sub_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 != 404) { michael@0: throw "Loaded an xhr from the wrong location!"; michael@0: } michael@0: michael@0: importScripts(importSubURL); michael@0: var worker = new Worker("relativeLoad_sub_worker2.js"); michael@0: worker.onerror = function(event) { michael@0: throw event.data; michael@0: }; michael@0: worker.onmessage = function(event) { michael@0: if (event.data != workerSubURL) { michael@0: throw "Bad data!"; michael@0: } michael@0: postMessage(workerSubURL); michael@0: }; michael@0: };