Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test runs only with pattern: os != 'android'
- Manifest: toolkit/profile/test/xpcshell/xpcshell.toml
/* Any copyright is dedicated to the Public Domain.
const { ProfileMetrics } = ChromeUtils.importESModule(
"moz-src:///toolkit/profile/ProfileMetrics.sys.mjs"
);
const { AsyncShutdown } = ChromeUtils.importESModule(
"resource://gre/modules/AsyncShutdown.sys.mjs"
);
add_task(async function test_no_install_data_files() {
Services.fog.testResetFOG();
selectStartupProfile();
Services.prefs.setBoolPref("toolkit.profiles.newProfileSubmitted", false);
Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
await ProfileMetrics.init();
await GleanPings.newProfile.testSubmission(
() => {
Assert.equal(
Glean.profiles.daysSinceUpdate.testGetValue(),
undefined,
"Should not set days_since_update when file is missing"
);
Assert.equal(
Glean.profiles.daysSinceInstall.testGetValue(),
undefined,
"Should not set days_since_install when file is missing"
);
},
() => {
AsyncShutdown.profileBeforeChange._trigger();
}
);
});