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
6 * used in a snap environment.
10 let defaultProfile = makeRandomProfileDir("default");
12 // Just pretend this profile was last used by something in the profile dir.
13 let greDir = gProfD.clone();
15 writeCompatibilityIni(defaultProfile, greDir, greDir);
20 name: PROFILE_DEFAULT,
21 path: defaultProfile.leafName,
27 simulateSnapEnvironment();
29 let { profile: selectedProfile, didCreate } = selectStartupProfile();
30 checkStartupReason("default");
32 let profileData = readProfilesIni();
33 let installsINI = gDataHome.clone();
34 installsINI.append("installs.ini");
36 !installsINI.exists(),
37 "Installs database should not have been created."
41 profileData.options.startWithLastProfile,
42 "Should be set to start with the last profile."
45 profileData.profiles.length,
47 "Should have the right number of profiles."
50 let profile = profileData.profiles[0];
51 Assert.equal(profile.name, PROFILE_DEFAULT, "Should have the right name.");
54 defaultProfile.leafName,
55 "Should be the original default profile."
57 Assert.ok(profile.default, "Should be marked as the old-style default.");
59 checkProfileService(profileData);
61 Assert.ok(!didCreate, "Should not have created a new profile.");
63 selectedProfile.rootDir.equals(defaultProfile),
64 "Should be using the right directory."
66 Assert.equal(selectedProfile.name, PROFILE_DEFAULT);