зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset c29af4939f66 (bug 1581898) for crashinf mochitests CLOSED TREE
This commit is contained in:
Родитель
d9d82b8278
Коммит
efe859aeb7
|
@ -305,5 +305,3 @@ scheme=http
|
|||
fail-if = 1
|
||||
[test_setSinkId.html]
|
||||
skip-if = os != 'linux' # the only platform with real devices
|
||||
[test_peerConnection_telephoneEventFirst.html]
|
||||
skip-if = toolkit == 'android' # android(Bug 1189784, timeouts on 4.3 emulator)
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<script type="application/javascript" src="pc.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
createHTML({
|
||||
title: "RTCPeerConnection with telephone-event codec first in SDP",
|
||||
bug: "1581898",
|
||||
visible: true
|
||||
});
|
||||
|
||||
const test = async () => {
|
||||
const pc1 = new RTCPeerConnection();
|
||||
const pc2 = new RTCPeerConnection();
|
||||
const stream = await navigator.mediaDevices.getUserMedia({audio:true});
|
||||
pc1.addTrack(stream.getAudioTracks()[0], stream);
|
||||
pc2.addTrack(stream.getAudioTracks()[0], stream);
|
||||
|
||||
const offer = await pc1.createOffer();
|
||||
await pc1.setLocalDescription(offer);
|
||||
|
||||
const regex = /^(m=audio \d+ [^ ]+) (.*) 101(.*)$/m;
|
||||
|
||||
// Rewrite offer so payload type 101 comes first
|
||||
offer.sdp = offer.sdp.replace(regex, '$1 101 $2 $3');
|
||||
|
||||
ok(offer.sdp.match(/^m=audio \d+ [^ ]+ 101 /m),
|
||||
"Payload type 101 should be first on the m-line");
|
||||
|
||||
await pc2.setRemoteDescription(offer);
|
||||
const answer = await pc2.createAnswer();
|
||||
|
||||
pc1.onicecandidate = e => { pc2.addIceCandidate(e.candidate); }
|
||||
pc2.onicecandidate = e => { pc1.addIceCandidate(e.candidate); }
|
||||
|
||||
await pc1.setRemoteDescription(answer);
|
||||
await pc2.setLocalDescription(answer);
|
||||
await new Promise(resolve => {
|
||||
pc1.oniceconnectionstatechange = e => {
|
||||
if (pc1.iceConnectionState == "connected") {
|
||||
resolve();
|
||||
}
|
||||
};
|
||||
});
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
networkTestFinished();
|
||||
};
|
||||
|
||||
runNetworkTest(test);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче