1 /* eslint-env worker */
3 onmessage = function (event) {
5 var worker = new Worker("url_worker.js");
6 worker.onmessage = function (ev) {
10 worker.postMessage(event.data - 1);
16 if (URL instanceof Object) {
21 postMessage({ type: "status", status, msg: "URL object:" + URL });
30 postMessage({ type: "status", status, msg: "Blob:" + blob });
35 url = URL.createObjectURL(blob);
39 postMessage({ type: "status", status, msg: "Blob URL:" + url });
43 URL.revokeObjectURL(url);
47 postMessage({ type: "status", status, msg: "Blob Revoke URL" });
52 url = URL.createObjectURL(true);
60 msg: "CreateObjectURL should fail if the arg is not a blob",
66 url = URL.createObjectURL(blob);
70 postMessage({ type: "status", status, msg: "Blob URL2:" + url });
71 postMessage({ type: "url", url });
75 URL.createObjectURL({});
80 postMessage({ type: "status", status, msg: "Exception wanted" });
82 blob = new Blob([123]);
83 var uri = URL.createObjectURL(blob);
87 msg: "The URI has been generated from the blob",
93 status: u.origin == location.origin,
94 msg: "The URL generated from a blob URI has an origin.",
97 postMessage({ type: "finish" });