1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
5 * Tests that if installs.ini lists a profile we use it as the default.
9 let hash = xreDirProvider.getInstallHash();
10 let defaultProfile = makeRandomProfileDir("default");
11 let dedicatedProfile = makeRandomProfileDir("dedicated");
12 let devProfile = makeRandomProfileDir("devedition");
14 // Make sure we don't steal the old-style default.
15 writeCompatibilityIni(defaultProfile);
21 path: defaultProfile.leafName,
26 path: dedicatedProfile.leafName,
29 name: "dev-edition-default",
30 path: devProfile.leafName,
35 default: dedicatedProfile.leafName,
43 let { profile: selectedProfile, didCreate } = selectStartupProfile();
44 checkStartupReason("default");
46 let profileData = readProfilesIni();
49 profileData.options.startWithLastProfile,
50 "Should be set to start with the last profile."
53 profileData.profiles.length,
55 "Should have the right number of profiles."
58 let profile = profileData.profiles[0];
59 Assert.equal(profile.name, `dedicated`, "Should have the right name.");
62 dedicatedProfile.leafName,
63 "Should be the expected dedicated profile."
65 Assert.ok(!profile.default, "Should not be marked as the old-style default.");
67 profile = profileData.profiles[1];
68 Assert.equal(profile.name, "default", "Should have the right name.");
71 defaultProfile.leafName,
72 "Should be the original default profile."
74 Assert.ok(profile.default, "Should be marked as the old-style default.");
77 Object.keys(profileData.installs).length,
79 "Should be two known installs."
82 profileData.installs[hash].default,
83 dedicatedProfile.leafName,
84 "Should have kept the default for this install."
87 profileData.installs.otherhash.default,
89 "Should have kept the default for the other install."
92 checkProfileService(profileData);
94 Assert.ok(!didCreate, "Should not have created a new profile.");
96 selectedProfile.rootDir.equals(dedicatedProfile),
97 "Should be using the right directory."
99 Assert.equal(selectedProfile.name, "dedicated");