test_bug1008126.html (1944B)
1 <!-- 2 2 Any copyright is dedicated to the Public Domain. 3 3 http://creativecommons.org/publicdomain/zero/1.0/ 4 4 --> 5 <!DOCTYPE HTML> 6 <html> 7 <!-- 8 https://bugzilla.mozilla.org/show_bug.cgi?id=1008126 9 --> 10 <head> 11 <meta charset="utf-8"> 12 <title>Test for Bug 1008126</title> 13 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 14 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/> 15 </head> 16 <body> 17 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1008126">Mozilla Bug 1008126</a> 18 <p id="display"></p> 19 <div id="content" style="display: none"> 20 21 </div> 22 <pre id="test"> 23 <script type="application/javascript"> 24 function translateChrome(uriStr) { 25 const { Cc, Ci } = SpecialPowers; 26 let ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); 27 let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry); 28 let uri = ios.newURI(uriStr, null, ios.newURI(document.baseURI)); 29 return chromeReg.convertChromeURL(uri).spec; 30 } 31 32 function runTest() { 33 var worker = new Worker("file_bug1008126_worker.js"); 34 35 worker.onmessage = function(event) { 36 if (event.data.type == 'finish') { 37 SimpleTest.finish(); 38 } else if (event.data.type == 'status') { 39 ok(event.data.status, event.data.msg); 40 } 41 }; 42 43 worker.onerror = function(event) { 44 is(event.target, worker); 45 ok(false, "Worker had an error: " + event.filename + ":" + event.lineno + ":" + event.colno + ": " + event.message); 46 SimpleTest.finish(); 47 }; 48 49 worker.postMessage(translateChrome("file_bug945152.jar")); 50 } 51 52 SimpleTest.waitForExplicitFinish(); 53 54 addLoadEvent(function() { 55 SpecialPowers.pushPrefEnv({"set": [["dom.mapped_arraybuffer.enabled", true]]}, function() { 56 SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], runTest); 57 }); 58 }); 59 </script> 60 </pre> 61 </body> 62 </html>