Bug 1539809 - Part 0: Add a wpt that triggers this bug. r=jib

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Byron Campen [:bwc] 2019-03-29 22:38:08 +00:00
Родитель 7a09de96f9
Коммит 335cf0390a
1 изменённых файлов: 27 добавлений и 0 удалений

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

@ -132,4 +132,31 @@
await pc1.setLocalDescription(offer1);
}, `local offer created before setRemoteDescription(remote offer) then rollback should still be usable`);
promise_test(async t => {
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
t.add_cleanup(() => pc2.close());
const stream = await getNoiseStream({ video: true });
t.add_cleanup(() => stream.getTracks().forEach(track => track.stop()));
pc1.addTrack(stream.getTracks()[0], stream);
// We don't use this right away. pc1 has provisionally decided that the
// (only) transceiver is bound to level 0.
const offer1 = await pc1.createOffer();
// Create offer from pc2, apply and rollback on pc1
const offer2 = await pc2.createOffer({offerToReceiveAudio: true, offerToReceiveVideo: true});
// pc1 now should change its mind about what level its video transceiver is
// bound to. It was 0, now it is 1.
await pc1.setRemoteDescription(offer2);
// Rolling back should put things back the way they were.
await pc1.setRemoteDescription({type: "rollback"});
// Then try applying pc1's old offer
await pc1.setLocalDescription(offer1);
}, "local offer created before setRemoteDescription(remote offer) with different transceiver level assignments then rollback should still be usable");
</script>