mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 03:49:42 +00:00
Bug 1743122 - Disable TRR temp blocklist feature in tests. r=valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D132245
This commit is contained in:
parent
c0e84672de
commit
a993ca428a
@ -9856,6 +9856,15 @@
|
||||
value: @IS_NIGHTLY_BUILD@
|
||||
mirror: always
|
||||
|
||||
# If false, the temporary blocklisting feature is disabled.
|
||||
# This is useful for tests to prevent bleeding extra reqs
|
||||
# between tasks, since we may attempt to look up the
|
||||
# parent domain in the background when blocklisting a host.
|
||||
- name: network.trr.temp_blocklist
|
||||
type: RelaxedAtomicBool
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
# Single TRR request timeout, in milliseconds
|
||||
- name: network.trr.request_timeout_ms
|
||||
type: RelaxedAtomicUint32
|
||||
|
@ -889,6 +889,11 @@ bool TRRService::IsTemporarilyBlocked(const nsACString& aHost,
|
||||
bool aPrivateBrowsing,
|
||||
bool aParentsToo) // false if domain
|
||||
{
|
||||
if (!StaticPrefs::network_trr_temp_blocklist()) {
|
||||
LOG(("TRRService::IsTemporarilyBlocked temp blocklist disabled by pref"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mMode == nsIDNSService::MODE_TRRONLY) {
|
||||
return false; // might as well try
|
||||
}
|
||||
@ -970,6 +975,11 @@ bool TRRService::IsExcludedFromTRR_unlocked(const nsACString& aHost) {
|
||||
void TRRService::AddToBlocklist(const nsACString& aHost,
|
||||
const nsACString& aOriginSuffix,
|
||||
bool privateBrowsing, bool aParentsToo) {
|
||||
if (!StaticPrefs::network_trr_temp_blocklist()) {
|
||||
LOG(("TRRService::AddToBlocklist temp blocklist disabled by pref"));
|
||||
return;
|
||||
}
|
||||
|
||||
LOG(("TRR blocklist %s\n", nsCString(aHost).get()));
|
||||
nsAutoCString hashkey(aHost + aOriginSuffix);
|
||||
|
||||
|
@ -60,6 +60,11 @@ function trr_test_setup() {
|
||||
// Turn off strict fallback mode for most tests, it is tested specifically.
|
||||
Services.prefs.setBoolPref("network.trr.strict_native_fallback", false);
|
||||
|
||||
// Turn off temp blocklist feature in tests. When enabled we may issue a
|
||||
// lookup to resolve a parent name when blocklisting, which may bleed into
|
||||
// and interfere with subsequent tasks.
|
||||
Services.prefs.setBoolPref("network.trr.temp_blocklist", false);
|
||||
|
||||
// We intentionally don't set the TRR mode. Each test should set it
|
||||
// after setup in the first test.
|
||||
|
||||
@ -95,6 +100,7 @@ function trr_clear_prefs() {
|
||||
"network.trr.send_empty_accept-encoding_headers"
|
||||
);
|
||||
Services.prefs.clearUserPref("network.trr.strict_native_fallback");
|
||||
Services.prefs.clearUserPref("network.trr.temp_blocklist");
|
||||
}
|
||||
|
||||
/// This class sends a DNS query and can be awaited as a promise to get the
|
||||
|
Loading…
x
Reference in New Issue
Block a user