Commit e1babdd8 authored by valenting's avatar valenting
Browse files

Bug 1741554 - Prevent browser_connection_dnsoverhttps.js from connecting to...

Bug 1741554 - Prevent browser_connection_dnsoverhttps.js from connecting to non-local DoH IP. r=Gijs, a=test-only

Differential Revision: https://phabricator.services.mozilla.com/D136230
parent 9f57c4ff
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -63,8 +63,6 @@ skip-if = os != "win" # Windows-specific handler application selection dialog
[browser_connection_bug1505330.js]
skip-if = (verify && debug && (os == 'linux' || os == 'mac'))
[browser_connection_dnsoverhttps.js]
skip-if =
  os == 'win' && bits == 64 && !debug # Bug 1741554
[browser_contentblocking_categories.js]
[browser_contentblocking.js]
[browser_contentblocking_standard_tcp_toggle.js]
+9 −0
Original line number Diff line number Diff line
@@ -46,6 +46,15 @@ const defaultPrefValues = Object.freeze({
  [TRR_CUSTOM_URI_PREF]: "",
});

// See bug 1741554. This test should not actually try to create a connection to
// the real DoH endpoint. But a background request could do that while the test
// is in progress, before we've actually disabled TRR, and would cause a crash
// due to connecting to a non-local IP.
// To prevent that we override the IP to a local address.
Cc["@mozilla.org/network/native-dns-override;1"]
  .getService(Ci.nsINativeDNSResolverOverride)
  .addIPOverride("mozilla.cloudflare-dns.com", "127.0.0.1");

async function resetPrefs() {
  await DoHTestUtils.resetRemoteSettingsConfig();
  await DoHController._uninit();