bug1063538_worker.js (560B)
1 /** 2 * Any copyright is dedicated to the Public Domain. 3 * http://creativecommons.org/publicdomain/zero/1.0/ 4 */ 5 6 var gURL = "http://example.org/tests/dom/workers/test/bug1063538.sjs"; 7 var xhr = new XMLHttpRequest({ mozAnon: true, mozSystem: true }); 8 var progressFired = false; 9 10 xhr.onloadend = function (e) { 11 postMessage({ type: "finish", progressFired }); 12 self.close(); 13 }; 14 15 xhr.onprogress = function (e) { 16 if (e.loaded > 0) { 17 progressFired = true; 18 xhr.abort(); 19 } 20 }; 21 22 onmessage = function (e) { 23 xhr.open("GET", gURL, true); 24 xhr.send(); 25 };