Bug 841067 - Fix sandbox xhr tests. r=bz
authorBobby Holley <bobbyholley@gmail.com>
Thu, 14 Feb 2013 10:40:15 +0100
changeset 131766 c30b8926c2ceb164a84eb6d6403558c4a1011cb8
parent 131765 6542160e0f5ae2be55f23b6ecbfbb4132bcdc90d
child 131767 78c0b4615cfef1e62b8741d3546f8e92be2bd46f
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs841067
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 841067 - Fix sandbox xhr tests. r=bz
dom/tests/browser/browser_xhr_sandbox.js
--- a/dom/tests/browser/browser_xhr_sandbox.js
+++ b/dom/tests/browser/browser_xhr_sandbox.js
@@ -34,16 +34,16 @@ function test() {
     let workerWindow = frame.contentWindow;
     workerWindow.addEventListener("message", function(evt) {
       is(evt.data.result, "ok", "check the sandbox code was happy");
       finish();
     }, true);
     let sandbox = new Cu.Sandbox(workerWindow);
     // inject some functions from the window into the sandbox.
     // postMessage so the async code in the sandbox can report a result.
-    sandbox.importFunction(workerWindow.postMessage, "postMessage");
+    sandbox.importFunction(workerWindow.postMessage.bind(workerWindow), "postMessage");
     sandbox.importFunction(workerWindow.XMLHttpRequest, "XMLHttpRequest");
     Cu.evalInSandbox(sandboxCode, sandbox, "1.8");
   }, true);
 
   let container = doc.body ? doc.body : doc.documentElement;
   container.appendChild(frame);
 }