summaryrefslogtreecommitdiffstats
path: root/netwerk/test/unit/test_dns_service.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /netwerk/test/unit/test_dns_service.js
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/test/unit/test_dns_service.js')
-rw-r--r--netwerk/test/unit/test_dns_service.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/netwerk/test/unit/test_dns_service.js b/netwerk/test/unit/test_dns_service.js
index da404c1e7d..a4c167a6c3 100644
--- a/netwerk/test/unit/test_dns_service.js
+++ b/netwerk/test/unit/test_dns_service.js
@@ -121,3 +121,36 @@ add_task(
}
}
);
+
+add_task(
+ {
+ skip_if: () =>
+ Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT,
+ },
+ async function test_sort_family() {
+ Services.prefs.setBoolPref("network.dns.preferIPv6", true);
+ overrideService.clearOverrides();
+ overrideService.addIPOverride("example.com", "1.2.3.4");
+ overrideService.addIPOverride("example.com", "3.4.5.6");
+ overrideService.addIPOverride("example.com", "::1");
+ overrideService.addIPOverride("example.com", "::2");
+
+ let listener = new Listener();
+ Services.dns.asyncResolve(
+ "example.com",
+ Ci.nsIDNSService.RESOLVE_TYPE_DEFAULT,
+ Ci.nsIDNSService.RESOLVE_CANONICAL_NAME,
+ null, // resolverInfo
+ listener,
+ mainThread,
+ defaultOriginAttributes
+ );
+
+ let [, inRecord] = await listener;
+ inRecord.QueryInterface(Ci.nsIDNSAddrRecord);
+ Assert.equal(inRecord.getNextAddrAsString(), "::1");
+ Assert.equal(inRecord.getNextAddrAsString(), "::2");
+ Assert.equal(inRecord.getNextAddrAsString(), "1.2.3.4");
+ Assert.equal(inRecord.getNextAddrAsString(), "3.4.5.6");
+ }
+);