1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-06 12:02:40 +03:00

Test that calls in a group call are retried (#2637)

* Test that calls in a group call are retried

* Add new flushpromises file
This commit is contained in:
David Baker
2022-09-05 09:45:32 +01:00
committed by GitHub
parent 0d6a93b5f6
commit c78631bdee
4 changed files with 105 additions and 15 deletions

View File

@@ -79,6 +79,8 @@ export class MockRTCPeerConnection {
private negotiationNeededListener: () => void;
private needsNegotiation = false;
public readyToNegotiate: Promise<void>;
private onReadyToNegotiate: () => void;
localDescription: RTCSessionDescription;
signalingState: RTCSignalingState = "stable";
@@ -99,6 +101,10 @@ export class MockRTCPeerConnection {
toJSON: function() { },
};
this.readyToNegotiate = new Promise<void>(resolve => {
this.onReadyToNegotiate = resolve;
});
MockRTCPeerConnection.instances.push(this);
}
@@ -128,11 +134,13 @@ export class MockRTCPeerConnection {
getStats() { return []; }
addTrack(track: MockMediaStreamTrack) {
this.needsNegotiation = true;
this.onReadyToNegotiate();
return new MockRTCRtpSender(track);
}
removeTrack() {
this.needsNegotiation = true;
this.onReadyToNegotiate();
}
doNegotiation() {