dom/workers/test/subdir/relativeLoad_sub_worker.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:374f80230614
1 /**
2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/publicdomain/zero/1.0/
4 */
5 const importSubURL = "relativeLoad_sub_import.js";
6
7 onmessage = function(event) {
8 var xhr = new XMLHttpRequest();
9 xhr.open("GET", "testXHR.txt", false);
10 xhr.send(null);
11 if (xhr.status != 404) {
12 throw "Loaded an xhr from the wrong location!";
13 }
14
15 importScripts(importSubURL);
16 var worker = new Worker("relativeLoad_sub_worker2.js");
17 worker.onerror = function(event) {
18 throw event.data;
19 };
20 worker.onmessage = function(event) {
21 if (event.data != workerSubURL) {
22 throw "Bad data!";
23 }
24 postMessage(workerSubURL);
25 };
26 };

mercurial