зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1800136: Test-cases for ICE candidate stats. r=jib
Differential Revision: https://phabricator.services.mozilla.com/D162321
This commit is contained in:
Родитель
33170958b2
Коммит
bdcfd5c090
|
@ -1,5 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<meta name="timeout" content="long">
|
||||
<title>RTCRtpReceiver.prototype.getStats</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
@ -122,4 +123,23 @@
|
|||
validateStatsReport(statsReportSecond);
|
||||
}, 'receiver.getStats() should work with a closed PeerConnection');
|
||||
|
||||
promise_test(async t => {
|
||||
const caller = new RTCPeerConnection();
|
||||
t.add_cleanup(() => caller.close());
|
||||
const callee = new RTCPeerConnection();
|
||||
t.add_cleanup(() => callee.close());
|
||||
const stream = await getNoiseStream({audio:true});
|
||||
t.add_cleanup(() => stream.getTracks().forEach(track => track.stop()));
|
||||
const [track] = stream.getTracks();
|
||||
caller.addTrack(track, stream);
|
||||
|
||||
exchangeIceCandidates(caller, callee);
|
||||
exchangeIceCandidates(callee, caller);
|
||||
await exchangeOfferAnswer(caller, callee);
|
||||
await waitForIceStateChange(caller, ['checking']);
|
||||
const receiver = callee.getReceivers()[0];
|
||||
const statsReport = await receiver.getStats();
|
||||
assert_stats_report_has_stats(statsReport, ['candidate-pair', 'local-candidate', 'remote-candidate']);
|
||||
}, 'receiver.getStats() should return stats report containing ICE candidate stats');
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<meta name="timeout" content="long">
|
||||
<title>RTCRtpSender.prototype.getStats</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
@ -72,4 +73,22 @@
|
|||
assert_stats_report_has_stats(statsReport, ['outbound-rtp']);
|
||||
}, 'sender.getStats() via addTrack should return stats report containing outbound-rtp stats');
|
||||
|
||||
promise_test(async t => {
|
||||
const caller = new RTCPeerConnection();
|
||||
t.add_cleanup(() => caller.close());
|
||||
const callee = new RTCPeerConnection();
|
||||
t.add_cleanup(() => callee.close());
|
||||
const stream = await getNoiseStream({audio:true});
|
||||
t.add_cleanup(() => stream.getTracks().forEach(track => track.stop()));
|
||||
const [track] = stream.getTracks();
|
||||
const { sender } = caller.addTransceiver(track);
|
||||
|
||||
exchangeIceCandidates(caller, callee);
|
||||
exchangeIceCandidates(callee, caller);
|
||||
await exchangeOfferAnswer(caller, callee);
|
||||
await waitForIceStateChange(caller, ['checking']);
|
||||
const statsReport = await sender.getStats();
|
||||
assert_stats_report_has_stats(statsReport, ['candidate-pair', 'local-candidate', 'remote-candidate']);
|
||||
}, 'sender.getStats() should return stats report containing ICE candidate stats');
|
||||
|
||||
</script>
|
||||
|
|
Загрузка…
Ссылка в новой задаче