2 start(ok, is, finish) {
3 let worker = new ChromeWorker("esm_url_worker.js");
4 worker.onmessage = function (event) {
5 if (event.data.type == "status") {
6 ok(event.data.status, event.data.msg);
7 } else if (event.data.type == "url") {
8 var xhr = new XMLHttpRequest();
9 xhr.open("GET", event.data.url, false);
10 xhr.onreadystatechange = function () {
11 if (xhr.readyState == 4) {
12 ok(true, "Blob readable!");
13 URL.revokeObjectURL(event.data.url);
17 xhr.onerror = function () {
18 ok(false, "Blob unreadable, should not happen!");
19 URL.revokeObjectURL(event.data.url);
27 worker.onerror = function (event) {
28 is(event.target, worker);
29 ok(false, "Worker had an error: " + event.data);
30 self.worker.terminate();
34 worker.postMessage(0);