summaryrefslogtreecommitdiffstats
path: root/toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js
blob: 4606aec04e675bd5670b969dd9a910fc4f2cc988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 || "", "");
});