diff options
Diffstat (limited to 'toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js')
-rw-r--r-- | toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js b/toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js new file mode 100644 index 000000000..4606aec04 --- /dev/null +++ b/toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js @@ -0,0 +1,17 @@ +"use strict"; + +let env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment); + +add_task(function* test_getEnvironment() { + env.set("FOO", "BAR"); + + let environment = Subprocess.getEnvironment(); + + equal(environment.FOO, "BAR"); + equal(environment.PATH, env.get("PATH")); + + env.set("FOO", null); + + environment = Subprocess.getEnvironment(); + equal(environment.FOO || "", ""); +}); |