Bug 1284103 - Add mochitest for DTLS versions; r=mt

Differential Revision: https://phabricator.services.mozilla.com/D60009

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dan Minor 2020-01-30 12:50:16 +00:00
Родитель b3f3f1b7d6
Коммит 2dfc28fbbe
2 изменённых файлов: 43 добавлений и 0 удалений

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

@ -43,6 +43,7 @@ skip-if = toolkit == 'android' # no hostname obfuscation on android
[test_dataChannel_bug1013809.html]
[test_dataChannel_dataOnlyBufferedAmountLow.html]
scheme=http
[test_dataChannel_dtlsVersions.html]
[test_dataChannel_noOffer.html]
scheme=http
[test_enumerateDevices.html]

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

@ -0,0 +1,42 @@
<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({
bug: "1284103",
title: "Test basic data channel audio connection for supported DTLS versions"
});
async function testDtlsVersion(options, version) {
await SpecialPowers.pushPrefEnv({
set: [
["media.peerconnection.dtls.version.min", version],
["media.peerconnection.dtls.version.max", version]
]
});
const test = new PeerConnectionTest(options);
addInitialDataChannel(test.chain);
test.setMediaConstraints([{audio: true}], [{audio: true}]);
// This inlines test.run(), to allow for multiple tests to run.
test.updateChainSteps();
await test.chain.execute();
await test.close();
}
runNetworkTest(async (options) => {
// 770 = DTLS 1.0, 771 = DTLS 1.2, 772 = DTLS 1.3
for (var version = 770; version <= 772; version++) {
await testDtlsVersion(options, version);
}
networkTestFinished();
});
</script>
</pre>
</body>
</html>