Bug 1602757: Telemetry checks overrideUpdateChannel only at process startup r=chutten

Since this is checked only at startup, to ensure it propagates to all
content processes we have to ensure we shut down and restart all
preallocated or cached processes (though the process running the current
page won't restart)

Differential Revision: https://phabricator.services.mozilla.com/D76188
This commit is contained in:
Randell Jesup 2020-05-30 14:38:51 +00:00
Родитель 056d7011bc
Коммит 5d67f60e94
1 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

@ -30,9 +30,19 @@ async function waitForProcessesScalars(
add_task(async function test_setup() {
// Make sure the newly spawned content processes will have extended Telemetry enabled.
// Since Telemetry reads the prefs only at process startup, flush all cached
// and preallocated processes so they pick up the setting.
await SpecialPowers.pushPrefEnv({
set: [[TelemetryUtils.Preferences.OverridePreRelease, true]],
set: [
[TelemetryUtils.Preferences.OverridePreRelease, true],
["dom.ipc.processPrelaunch.enabled", false],
],
});
Services.ppmm.releaseCachedProcesses();
await SpecialPowers.pushPrefEnv({
set: [["dom.ipc.processPrelaunch.enabled", true]],
});
// And take care of the already initialized one as well.
let canRecordExtended = Services.telemetry.canRecordExtended;
Services.telemetry.canRecordExtended = true;
@ -121,9 +131,9 @@ add_task(async function test_recording() {
);
// Wait for the dynamic scalars to appear non-keyed snapshots.
await waitForProcessesScalars(["dynamic"], false, scalars => {
await waitForProcessesScalars(["dynamic"], true, scalars => {
// Wait for the scalars set in the content process to be available.
return "telemetry.test.dynamic.pre_content_spawn" in scalars.dynamic;
return "telemetry.test.dynamic.post_content_spawn_keyed" in scalars.dynamic;
});
// Verify the content of the snapshots.