summaryrefslogtreecommitdiffstats
path: root/toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js
blob: 1440670ddcc7a35802f2c9bfd34ff256ea35ee7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"use strict";

let env = Cc["@mozilla.org/process/environment;1"].getService(
  Ci.nsIEnvironment
);

add_task(async 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 || "", "");
});