Backed out changeset 6e7c2bd7d2f7 (bug 1673315) for failures on test_dns_override_for_localhost.js. CLOSED TREE
authorCsoregi Natalia <ncsoregi@mozilla.com>
Tue, 27 Oct 2020 20:19:36 +0200
changeset 554772 034317140549d9021ec0017ae5bf401aaa9a53b1
parent 554771 44db783208d763827d676c14e54159a4404b3b09
child 554773 1ee79a29229aa09f7da826a8a2d1c609666dafd2
push id129563
push userncsoregi@mozilla.com
push dateTue, 27 Oct 2020 18:23:53 +0000
treeherderautoland@1ee79a29229a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1673315
milestone84.0a1
backs out6e7c2bd7d2f7482a90798028befaab9f405e805d
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 6e7c2bd7d2f7 (bug 1673315) for failures on test_dns_override_for_localhost.js. CLOSED TREE
netwerk/test/unit/test_dns_override_for_localhost.js
netwerk/test/unit/xpcshell.ini
deleted file mode 100644
--- a/netwerk/test/unit/test_dns_override_for_localhost.js
+++ /dev/null
@@ -1,92 +0,0 @@
-"use strict";
-
-const dns = Cc["@mozilla.org/network/dns-service;1"].getService(
-  Ci.nsIDNSService
-);
-const override = Cc["@mozilla.org/network/native-dns-override;1"].getService(
-  Ci.nsINativeDNSResolverOverride
-);
-const defaultOriginAttributes = {};
-const threadManager = Cc["@mozilla.org/thread-manager;1"].getService(
-  Ci.nsIThreadManager
-);
-const mainThread = threadManager.currentThread;
-
-class Listener {
-  constructor() {
-    this.promise = new Promise(resolve => {
-      this.resolve = resolve;
-    });
-  }
-
-  onLookupComplete(inRequest, inRecord, inStatus) {
-    this.resolve([inRequest, inRecord, inStatus]);
-  }
-
-  async addresses() {
-    let [inRequest, inRecord, inStatus] = await this.promise;
-    let addresses = [];
-    if (!inRecord) {
-      return addresses; // returns []
-    }
-    inRecord.QueryInterface(Ci.nsIDNSAddrRecord);
-    while (inRecord.hasMore()) {
-      addresses.push(inRecord.getNextAddrAsString());
-    }
-    return addresses;
-  }
-
-  then() {
-    return this.promise.then.apply(this.promise, arguments);
-  }
-}
-Listener.prototype.QueryInterface = ChromeUtils.generateQI(["nsIDNSListener"]);
-
-["localhost", "vhost.localhost"].forEach(domain => {
-  add_task(async function test_() {
-    let listener1 = new Listener();
-    const overrides = ["1.2.3.4", "5.6.7.8"];
-    overrides.forEach(ip_address => {
-      override.addIPOverride(domain, ip_address);
-    });
-
-    // Verify that loopback host names are not overridden.
-    dns.asyncResolve(
-      domain,
-      Ci.nsIDNSService.RESOLVE_TYPE_DEFAULT,
-      0,
-      null,
-      listener1,
-      mainThread,
-      defaultOriginAttributes
-    );
-    Assert.deepEqual(
-      await listener1.addresses(),
-      ["127.0.0.1", "::1"],
-      `${domain} is not overridden`
-    );
-
-    // Verify that if localhost hijacking is enabled, the overrides
-    // registered above are taken into account.
-    Services.prefs.setBoolPref("network.proxy.allow_hijacking_localhost", true);
-    let listener2 = new Listener();
-    dns.asyncResolve(
-      domain,
-      Ci.nsIDNSService.RESOLVE_TYPE_DEFAULT,
-      0,
-      null,
-      listener2,
-      mainThread,
-      defaultOriginAttributes
-    );
-    Assert.deepEqual(
-      await listener2.addresses(),
-      overrides,
-      `${domain} is overridden`
-    );
-    Services.prefs.clearUserPref("network.proxy.allow_hijacking_localhost");
-
-    dns.clearCache(false);
-    override.clearOverrides();
-  });
-});
--- a/netwerk/test/unit/xpcshell.ini
+++ b/netwerk/test/unit/xpcshell.ini
@@ -435,18 +435,16 @@ skip-if = asan || tsan || os == 'win' ||
 [test_http3_perf.js]
 skip-if = asan || tsan || os == 'win' || os =='android'
 [test_node_execute.js]
 [test_loadgroup_cancel.js]
 [test_obs-fold.js]
 [test_defaultURI.js]
 [test_port_remapping.js]
 [test_dns_override.js]
-[test_dns_override_for_localhost.js]
-skip-if = socketprocess_networking # Bug 1640105
 [test_no_cookies_after_last_pb_exit.js]
 [test_trr_httpssvc.js]
 skip-if = os == "android"
 [test_trr_case_sensitivity.js]
 skip-if = os == "android"
 [test_trr_proxy.js]
 [test_trr_cname_chain.js]
 skip-if = os == "android"