mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Bug 1693527
- When migrating old TRR mode, don't clear network.trr.mode if its value is 5. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D105625
This commit is contained in:
parent
613f319b79
commit
5fbb6b0564
@ -234,7 +234,9 @@ const DoHController = {
|
||||
return;
|
||||
}
|
||||
|
||||
Preferences.reset(NETWORK_TRR_MODE_PREF);
|
||||
if (Preferences.get(NETWORK_TRR_MODE_PREF) !== 5) {
|
||||
Preferences.reset(NETWORK_TRR_MODE_PREF);
|
||||
}
|
||||
Preferences.reset(PREVIOUS_TRR_MODE_PREF);
|
||||
},
|
||||
|
||||
|
@ -30,4 +30,27 @@ add_task(async function testTRRModeMigration() {
|
||||
false,
|
||||
"TRR mode cleared."
|
||||
);
|
||||
|
||||
await DoHController._uninit();
|
||||
Preferences.set(prefs.NETWORK_TRR_MODE_PREF, 5);
|
||||
Preferences.set(prefs.PREVIOUS_TRR_MODE_PREF, 0);
|
||||
previousModePromise = TestUtils.waitForPrefChange(
|
||||
prefs.PREVIOUS_TRR_MODE_PREF
|
||||
);
|
||||
await DoHController.init();
|
||||
try {
|
||||
await TestUtils.waitForCondition(
|
||||
() => !Preferences.isSet(prefs.NETWORK_TRR_MODE_PREF)
|
||||
);
|
||||
ok(false, "TRR mode should not have been cleared after migration");
|
||||
} catch (e) {
|
||||
ok(true, "TRR mode wasn't cleared after migration");
|
||||
}
|
||||
await previousModePromise;
|
||||
is(
|
||||
Preferences.get(prefs.PREVIOUS_TRR_MODE_PREF),
|
||||
undefined,
|
||||
"Previous TRR mode pref cleared."
|
||||
);
|
||||
is(Preferences.get(prefs.NETWORK_TRR_MODE_PREF), 5, "TRR mode remained 5.");
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user