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 any build
6 * doesn't get updated to a dedicated profile for this build and we don't set
7 * the flag to show the user info about dedicated profiles.
10 add_task(async () => {
11 let hash = xreDirProvider.getInstallHash();
12 let defaultProfile = makeRandomProfileDir("default");
17 name: PROFILE_DEFAULT,
18 path: defaultProfile.leafName,
24 let { profile: selectedProfile, didCreate } = selectStartupProfile();
25 checkStartupReason("firstrun-created-default");
27 let profileData = readProfilesIni();
30 profileData.options.startWithLastProfile,
31 "Should be set to start with the last profile."
34 profileData.profiles.length,
36 "Should have the right number of profiles."
39 // Since there is already a profile with the desired name on dev-edition, a
40 // unique version will be used.
41 let expectedName = AppConstants.MOZ_DEV_EDITION
42 ? `${DEDICATED_NAME}-1`
45 let profile = profileData.profiles[0];
46 Assert.equal(profile.name, PROFILE_DEFAULT, "Should have the right name.");
49 defaultProfile.leafName,
50 "Should be the original default profile."
52 Assert.ok(profile.default, "Should be marked as the old-style default.");
53 profile = profileData.profiles[1];
54 Assert.equal(profile.name, expectedName, "Should have the right name.");
57 defaultProfile.leafName,
58 "Should not be the original default profile."
60 Assert.ok(!profile.default, "Should not be marked as the old-style default.");
63 Object.keys(profileData.installs).length,
65 "Should be a default for installs."
68 profileData.installs[hash].default,
70 "Should have the right default profile."
73 profileData.installs[hash].locked,
74 "Should have locked as we created this profile for this install."
77 checkProfileService(profileData);
79 Assert.ok(didCreate, "Should have created a new profile.");
81 !selectedProfile.rootDir.equals(defaultProfile),
82 "Should not be using the old directory."
84 Assert.equal(selectedProfile.name, expectedName);