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 root = makeRandomProfileDir("foo");
10 let local = gDataHomeLocal.clone();
15 startWithLastProfile: true,
34 writeProfilesIni(profileData);
35 checkProfileService(profileData);
37 Services.env.set("XRE_PROFILE_PATH", root.path);
38 Services.env.set("XRE_PROFILE_LOCAL_PATH", local.path);
40 let { rootDir, localDir, profile, didCreate } = selectStartupProfile([
44 checkStartupReason("restart");
46 Assert.ok(!didCreate, "Should not have created a new profile.");
47 Assert.ok(rootDir.equals(root), "Should have selected the right root dir.");
49 localDir.equals(local),
50 "Should have selected the right local dir."
52 Assert.ok(profile, "A named profile matches this.");
53 Assert.equal(profile.name, "Profile1", "The right profile was matched.");
55 let service = getProfileService();
57 service.defaultProfile,
59 "Should not be the default profile."