'let glob = this; new ' + function ContentScriptScope() {

      exportFunction(assert, unsafeWindow, { defineAs: "assert" });
      window.wrappedJSObject.assert(true, "assert exported");
      window.wrappedJSObject.exportedObj = { prop: 42 };
      window.wrappedJSObject.accessCheck();
      done();
    }
    'new ' + function ContentScriptScope() {
      // Check basic usage of functions
      let closure2 = function () {return "ok";};
      assert(window.wrappedJSObject.callFunction(closure2) == "ok", "Function references work");

      // Ensure that functions are cached when being wrapped to native code
      let closure = function () {};
      assert(window.wrappedJSObject.isEqual(closure, closure), "Function references are cached before being wrapped to native");
      done();
    }
Beispiel #3
0
 'new ' + function () {
   var assert = function assert(v, msg) {
     self.port.emit("assert", { assertion: v, msg: msg });
   }
   var done = function done() {
     self.port.emit("done");
   }
   window.wrappedJSObject.fuu = { bar: 42 };
   window.wrappedJSObject.assert = assert;
   window.wrappedJSObject.runTest();
   done();
 }