1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
5 * Previous versions of Firefox automatically used a single profile even if it
6 * wasn't marked as the default. So we should try to upgrade that one if it was
7 * last used by this build. This test checks the case where it wasn't.
10 add_task(async () => {
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);
22 path: defaultProfile.leafName,
28 let profileData = readProfilesIni();
31 profileData.options.startWithLastProfile,
32 "Should be set to start with the last profile."
35 profileData.profiles.length,
37 "Should have the right number of profiles."
40 let profile = profileData.profiles[0];
41 Assert.equal(profile.name, "default", "Should have the right name.");
44 defaultProfile.leafName,
45 "Should be the original default profile."
47 Assert.ok(!profile.default, "Should not be marked as the old-style default.");
49 Assert.ok(!profileData.installs, "Should be no defaults for installs yet.");
51 checkProfileService(profileData);
53 let { profile: selectedProfile, didCreate } = selectStartupProfile();
54 checkStartupReason("firstrun-skipped-default");
55 Assert.ok(didCreate, "Should have created a new profile.");
57 !selectedProfile.rootDir.equals(defaultProfile),
58 "Should be using the right directory."
60 Assert.equal(selectedProfile.name, DEDICATED_NAME);
62 profileData = readProfilesIni();
64 profile = profileData.profiles[0];
65 Assert.equal(profile.name, "default", "Should have the right name.");
68 defaultProfile.leafName,
69 "Should be the original default profile."
71 Assert.ok(profile.default, "Should now be marked as the old-style default.");
73 checkProfileService(profileData);