1
0
Fork 0
firefox/js/xpconnect/tests/unit/test_want_components.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

16 lines
629 B
JavaScript

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");
}