You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
* stats: add summery stats reporter * stats: export summery stats reports * stats: fix typo of event name * stats: check promise condition for node 16 test linter * stats: remove weak test to figure out memory leak * stats: remove second weak test * stats: add starting processing test * stats: fix tests * stats: fix typo in group call * stats: fix stats report gathering test * stats: reactivate promise merge * stats: add track counter and track mute counter in summary stats * stats: add summery calculation * stats: fix PR issues * stats: adjust summery reporter for inbound and mute state * stats: check async state * stats: switch from an `Or` to `And` condition for entire received media value * stats: Add property description --------- Co-authored-by: David Baker <dbkr@users.noreply.github.com>
42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
/*
|
|
Copyright 2023 The Matrix.org Foundation C.I.C.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
import { Mid, Ssrc, MediaSsrcHandler } from "../../../../../src/webrtc/stats/media/mediaSsrcHandler";
|
|
import { REMOTE_SFU_DESCRIPTION } from "../../../../test-utils/webrtc";
|
|
|
|
describe("MediaSsrcHandler", () => {
|
|
const remoteMap = new Map<Mid, Ssrc[]>([
|
|
["0", ["2963372119"]],
|
|
["1", ["1212931603"]],
|
|
]);
|
|
let handler: MediaSsrcHandler;
|
|
beforeEach(() => {
|
|
handler = new MediaSsrcHandler();
|
|
});
|
|
describe("should parse description", () => {
|
|
it("and build mid ssrc map", async () => {
|
|
handler.parse(REMOTE_SFU_DESCRIPTION, "remote");
|
|
expect(handler.getSsrcToMidMap("remote")).toEqual(remoteMap);
|
|
});
|
|
});
|
|
|
|
describe("should on find mid by ssrc", () => {
|
|
it("and return mid if mapping exists.", async () => {
|
|
handler.parse(REMOTE_SFU_DESCRIPTION, "remote");
|
|
expect(handler.findMidBySsrc("2963372119", "remote")).toEqual("0");
|
|
});
|
|
});
|
|
});
|