Quelle test_trr_https_rr_with_cname.js
Sprache: JAVA
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var { setTimeout } = ChromeUtils.importESModule( "resource://gre/modules/Timer.sys.mjs"
);
let { inRecord } = await new TRRDNSListener(host, {
expectedAnswer: "127.0.0.1",
flags: Ci.nsIDNSService.RESOLVE_CANONICAL_NAME,
});
equal(inRecord.QueryInterface(Ci.nsIDNSAddrRecord).canonicalName, cname);
let chan = makeChan(`https://${host}:${h2Port}/`);
let [req] = await channelOpenPromise(chan, CL_ALLOW_UNKNOWN_CL); Assert.equal(req.protocolVersion, expectedVersion);
await trrServer.stop();
}
// Test the case that the pref is off and the cname is not the same as the // targetName. The expected protocol version being "h3" means that the last // svcb record is used.
add_task(async function test_https_rr_with_unmatched_cname() {
Services.prefs.setBoolPref( "network.dns.https_rr.check_record_with_cname", false
);
await do_test_https_rr_records( "alt1.example.com", "alt1.example.com",
h3Port, "not_used",
h3Port, "test.cname1.com", "h3"
);
});
// Test the case that the pref is on and the cname is not the same as the // targetName. Since there is no svcb record can be used, we fallback to "h2".
add_task(async function test_https_rr_with_unmatched_cname_1() {
Services.prefs.setBoolPref( "network.dns.https_rr.check_record_with_cname", true
);
await do_test_https_rr_records( "alt1.example.com", "alt1.example.com",
h3Port, "not_used",
h3Port, "test.cname1.com", "h2"
);
});
// Test the case that the pref is on and the cname is matched. We failed to // connect to the first record, but we successfully connect with the second one.
add_task(async function test_https_rr_with_matched_cname() {
Services.prefs.setBoolPref( "network.dns.https_rr.check_record_with_cname", true
);
await do_test_https_rr_records( "alt1.example.com", "not_used",
h3Port, "alt2.example.com",
h3Port, "alt2.example.com", "h3"
);
});
// Test the case that the pref is on and both records are failed to connect. // We can only fallback to "h2" when another pref is on.
add_task(async function test_https_rr_with_matched_cname_1() {
Services.prefs.setBoolPref( "network.dns.echconfig.fallback_to_origin_when_all_failed", true
);
await do_test_https_rr_records( "alt1.example.com", "not_used",
h3Port, "alt2.example.com",
h2Port, "alt2.example.com", "h2"
);
});
Messung V0.5
¤ Dauer der Verarbeitung: 0.17 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.