Bug 1596234 - TRR: Check that pushed entry is not used after DNS suffix list changes r=JuniorHsu
☠☠ backed out by fd438a5eca14 ☠ ☠
authorValentin Gosu <valentin.gosu@gmail.com>
Wed, 13 Nov 2019 21:56:48 +0000
changeset 501905 9f62b84d6bbb31cb27a8458946fa9fe4d86c8275
parent 501904 752fca530835e61a9ba5b1131b91e7d17b1e4564
child 501906 15ba6d5159446877cac2dee1ffa17cf53aba8d7a
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJuniorHsu
bugs1596234
milestone72.0a1
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
Bug 1596234 - TRR: Check that pushed entry is not used after DNS suffix list changes r=JuniorHsu Differential Revision: https://phabricator.services.mozilla.com/D52912
netwerk/test/unit/test_trr.js
--- a/netwerk/test/unit/test_trr.js
+++ b/netwerk/test/unit/test_trr.js
@@ -1090,33 +1090,36 @@ add_task(async function test_clearCacheO
 });
 
 add_task(async function test_dnsSuffix() {
   async function checkDnsSuffixInMode(mode) {
     dns.clearCache(true);
     Services.prefs.setIntPref("network.trr.mode", mode);
     Services.prefs.setCharPref(
       "network.trr.uri",
-      `https://localhost:${h2Port}/doh?responseIP=1.2.3.4`
+      `https://localhost:${h2Port}/doh?responseIP=1.2.3.4&push=true`
     );
-    await new DNSListener("test.com", "1.2.3.4");
+    await new DNSListener("example.com", "1.2.3.4");
     dns.clearCache(true);
     Services.prefs.setIntPref("network.trr.mode", mode);
 
     dns.clearCache(true);
     let networkLinkService = {
-      dnsSuffixList: ["test.com"],
+      dnsSuffixList: ["example.com"],
       QueryInterface: ChromeUtils.generateQI([Ci.nsINetworkLinkService]),
     };
     Services.obs.notifyObservers(
       networkLinkService,
       "network:link-status-changed",
       "changed"
     );
-    await new DNSListener("test.com", "127.0.0.1");
+    await new DNSListener("example.com", "127.0.0.1");
+
+    // Also test that we don't use the pushed entry.
+    await new DNSListener("push.example.com", "127.0.0.1");
 
     // Attempt to clean up, just in case
     networkLinkService.dnsSuffixList = [];
     Services.obs.notifyObservers(
       networkLinkService,
       "network:link-status-changed",
       "changed"
     );