1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
5 * Tests that an old-style default profile not previously used by this build gets
10 let hash = xreDirProvider.getInstallHash();
11 let defaultProfile = makeRandomProfileDir("default");
13 // Just pretend this profile was last used by something in the profile dir.
14 let greDir = gProfD.clone();
16 writeCompatibilityIni(defaultProfile, greDir, greDir);
21 name: PROFILE_DEFAULT,
22 path: defaultProfile.leafName,
28 let { profile: selectedProfile, didCreate } = selectStartupProfile();
29 checkStartupReason("firstrun-skipped-default");
31 let profileData = readProfilesIni();
34 profileData.options.startWithLastProfile,
35 "Should be set to start with the last profile."
38 profileData.profiles.length,
40 "Should have the right number of profiles."
43 // Since there is already a profile with the desired name on dev-edition, a
44 // unique version will be used.
45 let expectedName = AppConstants.MOZ_DEV_EDITION
46 ? `${DEDICATED_NAME}-1`
49 let profile = profileData.profiles[0];
50 Assert.equal(profile.name, PROFILE_DEFAULT, "Should have the right name.");
53 defaultProfile.leafName,
54 "Should be the original default profile."
56 Assert.ok(profile.default, "Should be marked as the old-style default.");
57 profile = profileData.profiles[1];
58 Assert.equal(profile.name, expectedName, "Should have the right name.");
61 defaultProfile.leafName,
62 "Should not be the original default profile."
64 Assert.ok(!profile.default, "Should not be marked as the old-style default.");
67 Object.keys(profileData.installs).length,
69 "Should be a default for this install."
72 profileData.installs[hash].default,
74 "Should have marked the new profile as the default for this install."
77 profileData.installs[hash].locked,
78 "Should have locked as we created this profile for this install."
81 checkProfileService(profileData);
83 Assert.ok(didCreate, "Should have created a new profile.");
85 !selectedProfile.rootDir.equals(defaultProfile),
86 "Should be using the right directory."
88 Assert.equal(selectedProfile.name, expectedName);