1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
5 * Tests that the environment variables are used to select a profile.
9 let dir = makeRandomProfileDir("foo");
13 startWithLastProfile: true,
32 writeProfilesIni(profileData);
33 checkProfileService(profileData);
35 let env = Cc["@mozilla.org/process/environment;1"].getService(
38 env.set("XRE_PROFILE_PATH", dir.path);
39 env.set("XRE_PROFILE_LOCAL_PATH", dir.path);
41 let { rootDir, localDir, profile, didCreate } = selectStartupProfile();
42 checkStartupReason("restart");
44 Assert.ok(!didCreate, "Should not have created a new profile.");
45 Assert.ok(rootDir.equals(dir), "Should have selected the right root dir.");
46 Assert.ok(localDir.equals(dir), "Should have selected the right local dir.");
47 Assert.ok(!profile, "No named profile matches this.");