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

Add a few new GroupCall tests (#2678)

Co-authored-by: Robin <robin@robin.town>
This commit is contained in:
Šimon Brandner
2022-09-20 19:40:47 +02:00
committed by GitHub
parent f41b7706e4
commit c400dd4ff8
2 changed files with 172 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ import { ReEmitter } from "../../src/ReEmitter";
import { SyncState } from "../../src/sync";
import { CallEvent, CallEventHandlerMap, MatrixCall } from "../../src/webrtc/call";
import { CallEventHandlerEvent, CallEventHandlerEventHandlerMap } from "../../src/webrtc/callEventHandler";
import { CallFeed } from "../../src/webrtc/callFeed";
import { GroupCallEventHandlerMap } from "../../src/webrtc/groupCall";
import { GroupCallEventHandlerEvent } from "../../src/webrtc/groupCallEventHandler";
import { IScreensharingOpts, MediaHandler } from "../../src/webrtc/mediaHandler";
@@ -384,6 +385,20 @@ export class MockCallMatrixClient extends TypedEventEmitter<EmittedEvents, Emitt
typed(): MatrixClient { return this as unknown as MatrixClient; }
}
export class MockCallFeed {
constructor(
public userId: string,
public stream: MockMediaStream,
) {}
measureVolumeActivity(val: boolean) {}
dispose() {}
typed(): CallFeed {
return this as unknown as CallFeed;
}
}
export function installWebRTCMocks() {
global.navigator = {
mediaDevices: new MockMediaDevices().typed(),