tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_want_components.js (629B)


      1 function run_test() {
      2  var sb;
      3 
      4  sb = Cu.Sandbox(this, {wantComponents: false});
      5  Assert.equal(Cu.evalInSandbox("this.Components", sb), undefined);
      6  Assert.equal(Cu.evalInSandbox("this.Services", sb), undefined);
      7 
      8  sb = Cu.Sandbox(this, {wantComponents: true});
      9  Assert.equal(Cu.evalInSandbox("typeof this.Components", sb), "object");
     10  Assert.equal(Cu.evalInSandbox("typeof this.Services", sb), "object");
     11 
     12  // wantComponents defaults to true.
     13  sb = Cu.Sandbox(this, {});
     14  Assert.equal(Cu.evalInSandbox("typeof this.Components", sb), "object");
     15  Assert.equal(Cu.evalInSandbox("typeof this.Services", sb), "object");
     16 }