summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/tests/unit/test_want_components.js
blob: 1c203c3e9d37531a60a1232c2d1e80a1763a835e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function run_test() {
  var sb;

  sb = Cu.Sandbox(this, {wantComponents: false});
  Assert.equal(Cu.evalInSandbox("this.Components", sb), undefined);
  Assert.equal(Cu.evalInSandbox("this.Services", sb), undefined);

  sb = Cu.Sandbox(this, {wantComponents: true});
  Assert.equal(Cu.evalInSandbox("typeof this.Components", sb), "object");
  Assert.equal(Cu.evalInSandbox("typeof this.Services", sb), "object");

  // wantComponents defaults to true.
  sb = Cu.Sandbox(this, {});
  Assert.equal(Cu.evalInSandbox("typeof this.Components", sb), "object");
  Assert.equal(Cu.evalInSandbox("typeof this.Services", sb), "object");
}