Bug 1665037 - Make sure we wait trrServer to stop r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D99391
This commit is contained in:
Kershaw Chang 2020-12-10 22:01:27 +00:00
Родитель f4dc4d8584
Коммит dc47506b2a
13 изменённых файлов: 41 добавлений и 17 удалений

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

@ -72,7 +72,7 @@ function setup() {
}
setup();
registerCleanupFunction(() => {
registerCleanupFunction(async () => {
prefs.clearUserPref("network.security.esni.enabled");
prefs.clearUserPref("network.http.spdy.enabled");
prefs.clearUserPref("network.http.spdy.enabled.http2");
@ -101,7 +101,7 @@ registerCleanupFunction(() => {
Services.prefs.clearUserPref("network.http.http3.backup_timer_delay");
Services.prefs.clearUserPref("network.http.speculative-parallel-limit");
if (trrServer) {
trrServer.stop();
await trrServer.stop();
}
});

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

@ -106,7 +106,9 @@ DNSListener.prototype.QueryInterface = ChromeUtils.generateQI([
// Test if IP hint addresses can be accessed as regular A/AAAA records.
add_task(async function testStoreIPHint() {
let trrServer = new TRRServer();
registerCleanupFunction(async () => trrServer.stop());
registerCleanupFunction(async () => {
await trrServer.stop();
});
await trrServer.start();
Services.prefs.setIntPref("network.trr.mode", 3);

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

@ -100,7 +100,9 @@ DNSListener.prototype.QueryInterface = ChromeUtils.generateQI([
add_task(async function testPriorityAndECHConfig() {
let trrServer = new TRRServer();
registerCleanupFunction(async () => trrServer.stop());
registerCleanupFunction(async () => {
await trrServer.stop();
});
await trrServer.start();
Services.prefs.setBoolPref("network.dns.echconfig.enabled", false);

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

@ -73,7 +73,7 @@ function setup() {
}
setup();
registerCleanupFunction(() => {
registerCleanupFunction(async () => {
prefs.clearUserPref("network.security.esni.enabled");
prefs.clearUserPref("network.http.spdy.enabled");
prefs.clearUserPref("network.http.spdy.enabled.http2");
@ -93,7 +93,9 @@ registerCleanupFunction(() => {
prefs.clearUserPref("network.dns.use_https_rr_as_altsvc");
prefs.clearUserPref("network.dns.echconfig.enabled");
prefs.clearUserPref("network.dns.echconfig.fallback_to_origin");
trrServer.stop();
if (trrServer) {
await trrServer.stop();
}
});
class DNSListener {

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

@ -77,7 +77,7 @@ function setup() {
}
setup();
registerCleanupFunction(() => {
registerCleanupFunction(async () => {
prefs.clearUserPref("network.security.esni.enabled");
prefs.clearUserPref("network.http.spdy.enabled");
prefs.clearUserPref("network.http.spdy.enabled.http2");
@ -97,7 +97,9 @@ registerCleanupFunction(() => {
prefs.clearUserPref("network.dns.use_https_rr_as_altsvc");
prefs.clearUserPref("network.dns.echconfig.enabled");
prefs.clearUserPref("network.dns.echconfig.fallback_to_origin");
trrServer.stop();
if (trrServer) {
await trrServer.stop();
}
});
class DNSListener {

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

@ -33,7 +33,9 @@ function channelOpenPromise(chan) {
}
let trrServer = new TRRServer();
registerCleanupFunction(async () => trrServer.stop());
registerCleanupFunction(async () => {
await trrServer.stop();
});
add_task(async function setup_server() {
await trrServer.start();
dump(`port = ${trrServer.port}\n`);

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

@ -34,7 +34,9 @@ function channelOpenPromise(chan) {
add_task(async function test_trr_casing() {
let trrServer = new TRRServer();
registerCleanupFunction(async () => trrServer.stop());
registerCleanupFunction(async () => {
await trrServer.stop();
});
await trrServer.start();
dump(`port = ${trrServer.port}\n`);
let chan = makeChan(`https://localhost:${trrServer.port}/test?bla=some`);

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

@ -34,7 +34,9 @@ function channelOpenPromise(chan) {
add_task(async function test_follow_cnames_same_response() {
let trrServer = new TRRServer();
registerCleanupFunction(async () => trrServer.stop());
registerCleanupFunction(async () => {
await trrServer.stop();
});
await trrServer.start();
dump(`port = ${trrServer.port}\n`);
let chan = makeChan(`https://localhost:${trrServer.port}/test?bla=some`);

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

@ -35,7 +35,9 @@ function channelOpenPromise(chan) {
let trrServer;
add_task(async function setup() {
trrServer = new TRRServer();
registerCleanupFunction(async () => trrServer.stop());
registerCleanupFunction(async () => {
await trrServer.stop();
});
await trrServer.start();
dump(`port = ${trrServer.port}\n`);
let chan = makeChan(`https://localhost:${trrServer.port}/test?bla=some`);

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

@ -73,7 +73,7 @@ function setup() {
}
setup();
registerCleanupFunction(() => {
registerCleanupFunction(async () => {
prefs.clearUserPref("network.security.esni.enabled");
prefs.clearUserPref("network.http.spdy.enabled");
prefs.clearUserPref("network.http.spdy.enabled.http2");
@ -96,7 +96,9 @@ registerCleanupFunction(() => {
prefs.clearUserPref("network.dns.httpssvc.reset_exclustion_list");
prefs.clearUserPref("network.http.http3.enabled");
prefs.clearUserPref("network.dns.httpssvc.http3_fast_fallback_timeout");
trrServer.stop();
if (trrServer) {
await trrServer.stop();
}
});
class DNSListener {

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

@ -207,7 +207,9 @@ add_task(async function testHTTPSSVC() {
add_task(async function test_aliasform() {
let trrServer = new TRRServer();
registerCleanupFunction(async () => trrServer.stop());
registerCleanupFunction(async () => {
await trrServer.stop();
});
await trrServer.start();
dump(`port = ${trrServer.port}\n`);

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

@ -58,7 +58,9 @@ function channelOpenPromise(chan) {
add_task(async function test_add_nat64_prefix_to_trr() {
let trrServer = new TRRServer();
registerCleanupFunction(async () => trrServer.stop());
registerCleanupFunction(async () => {
await trrServer.stop();
});
await trrServer.start();
dump(`port = ${trrServer.port}\n`);
let chan = makeChan(`https://localhost:${trrServer.port}/test?bla=some`);

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

@ -228,7 +228,9 @@ add_task(async function testUseHTTPSSVCAsHSTS() {
// Test if we can successfully fallback to the original host and port.
add_task(async function testFallback() {
let trrServer = new TRRServer();
registerCleanupFunction(async () => trrServer.stop());
registerCleanupFunction(async () => {
await trrServer.stop();
});
await trrServer.start();
Services.prefs.setIntPref("network.trr.mode", 3);