Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Errors
- This test gets skipped with pattern: os == 'android'
- This test failed 100 times in the preceding 30 days. quicksearch this test
- Manifest: toolkit/profile/test/xpcshell/xpcshell.toml
/* Any copyright is dedicated to the Public Domain.
/*
* Tests that the new profile ping is submitted correctly.
*/
add_task(async () => {
let hash = xreDirProvider.getInstallHash();
let profileData = {
options: {
startWithLastProfile: true,
},
profiles: [
{
name: "Profile1",
path: "Path1",
},
],
installs: {
[hash]: {
default: "Path1",
},
},
};
writeProfilesIni(profileData);
Services.prefs.setBoolPref("toolkit.profiles.newProfileSubmitted", false);
let { profile, didCreate } = selectStartupProfile();
checkStartupReason("default");
let service = getProfileService();
checkProfileService(profileData);
Assert.ok(!didCreate, "Should not have created a new profile.");
Assert.equal(
profile,
service.defaultProfile,
"Should have returned the default profile."
);
Assert.equal(
profile.name,
"Profile1",
"Should have selected the right profile"
);
await GleanPings.newProfile.testSubmission(
() => {},
() => {
Services.obs.notifyObservers(null, "test-quit-application");
}
);
Assert.ok(Services.prefs.getBoolPref("toolkit.profiles.newProfileSubmitted"));
});