Bug 1706422 - Initiaize DNS service earlier, r=necko-reviewers,valentin

The problem here is that the creation of DNS service and setting trr pref is racy.
This problem can be fixed by creating DNS service earlier.

Differential Revision: https://phabricator.services.mozilla.com/D139106
This commit is contained in:
Kershaw Chang 2022-02-18 12:48:06 +00:00
Родитель bb2c17bae7
Коммит 37d16eac92
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -39,6 +39,12 @@ function setup() {
// XXX(valentin): It would be nice to just call trr_test_setup() here, but
// the relative path here makes it awkward. Would be nice to fix someday.
addCertFromFile(certdb, "../unit/http2-ca.pem", "CTu,u,u");
if (!gDNS) {
gDNS = Cc["@mozilla.org/network/dns-service;1"].getService(
Ci.nsIDNSService
);
}
}
setup();