|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+import * as MediaType from '../../service/RTC/MediaType';
|
|
|
2
|
+import * as SignalingEvents from '../../service/RTC/SignalingEvents';
|
|
|
3
|
+import { getSourceNameForJitsiTrack } from '../../service/RTC/SignalingLayer';
|
|
|
4
|
+import VideoType from '../../service/RTC/VideoType';
|
|
|
5
|
+import XMPPEvents from '../../service/xmpp/XMPPEvents';
|
|
|
6
|
+import FeatureFlags from '../flags/FeatureFlags';
|
|
|
7
|
+import Listenable from '../util/Listenable';
|
|
|
8
|
+
|
|
|
9
|
+import SignalingLayerImpl, { SOURCE_INFO_PRESENCE_ELEMENT } from './SignalingLayerImpl';
|
|
|
10
|
+
|
|
|
11
|
+const INITIAL_SOURCE_INFO = { value: JSON.stringify({}) };
|
|
|
12
|
+
|
|
|
13
|
+// eslint-disable-next-line require-jsdoc
|
|
|
14
|
+function createMockChatRoom() {
|
|
|
15
|
+ const chatRoom = {
|
|
|
16
|
+ ...new Listenable(),
|
|
|
17
|
+ ...jasmine.createSpyObj('', [
|
|
|
18
|
+ 'addOrReplaceInPresence',
|
|
|
19
|
+ 'setAudioMute',
|
|
|
20
|
+ 'setVideoMute'
|
|
|
21
|
+ ])
|
|
|
22
|
+ };
|
|
|
23
|
+
|
|
|
24
|
+ const listeners = {};
|
|
|
25
|
+
|
|
|
26
|
+ // Stores presence listeners
|
|
|
27
|
+ chatRoom.addPresenceListener = (tagName, l) => {
|
|
|
28
|
+ listeners[tagName] || (listeners[tagName] = []);
|
|
|
29
|
+ listeners[tagName].push(l);
|
|
|
30
|
+ };
|
|
|
31
|
+
|
|
|
32
|
+ // Notify presence listeners
|
|
|
33
|
+ chatRoom.emitPresenceListener = (node, mucNick) => {
|
|
|
34
|
+ const nodeListeners = listeners[node.tagName];
|
|
|
35
|
+
|
|
|
36
|
+ if (nodeListeners) {
|
|
|
37
|
+ for (const l of nodeListeners) {
|
|
|
38
|
+ l(node, mucNick);
|
|
|
39
|
+ }
|
|
|
40
|
+ }
|
|
|
41
|
+ };
|
|
|
42
|
+
|
|
|
43
|
+ // Fakes 'SourceInfo' in the presence by adjusting getLastPresence return value and emitting a presence event.
|
|
|
44
|
+ chatRoom.mockSourceInfoPresence = (endpointId, sourceInfo) => {
|
|
|
45
|
+ chatRoom.getLastPresence = () => [ {
|
|
|
46
|
+ tagName: SOURCE_INFO_PRESENCE_ELEMENT,
|
|
|
47
|
+ value: JSON.stringify(sourceInfo)
|
|
|
48
|
+ } ];
|
|
|
49
|
+ chatRoom.emitPresenceListener({
|
|
|
50
|
+ tagName: SOURCE_INFO_PRESENCE_ELEMENT,
|
|
|
51
|
+ value: JSON.stringify(sourceInfo)
|
|
|
52
|
+ }, endpointId);
|
|
|
53
|
+ };
|
|
|
54
|
+
|
|
|
55
|
+ chatRoom.emitParticipantLeft = endpointId => {
|
|
|
56
|
+ // Only the resource part (MUC nick) is relevant
|
|
|
57
|
+ chatRoom.eventEmitter.emit(XMPPEvents.MUC_MEMBER_LEFT, `room@server.com/${endpointId}`);
|
|
|
58
|
+ };
|
|
|
59
|
+
|
|
|
60
|
+ return chatRoom;
|
|
|
61
|
+}
|
|
|
62
|
+
|
|
|
63
|
+describe('SignalingLayerImpl', () => {
|
|
|
64
|
+ describe('setTrackMuteStatus advertises the track muted status in the chat room', () => {
|
|
|
65
|
+ describe('with source name signaling enabled', () => {
|
|
|
66
|
+ const endpointId = 'abcdef12';
|
|
|
67
|
+ let signalingLayer;
|
|
|
68
|
+ let chatRoom;
|
|
|
69
|
+
|
|
|
70
|
+ beforeEach(() => {
|
|
|
71
|
+ FeatureFlags.init({ sourceNameSignaling: true });
|
|
|
72
|
+ signalingLayer = new SignalingLayerImpl();
|
|
|
73
|
+ chatRoom = createMockChatRoom();
|
|
|
74
|
+ signalingLayer.setChatRoom(chatRoom);
|
|
|
75
|
+
|
|
|
76
|
+ // No tracks yet
|
|
|
77
|
+ expect(chatRoom.addOrReplaceInPresence)
|
|
|
78
|
+ .toHaveBeenCalledWith(
|
|
|
79
|
+ SOURCE_INFO_PRESENCE_ELEMENT,
|
|
|
80
|
+ INITIAL_SOURCE_INFO);
|
|
|
81
|
+ });
|
|
|
82
|
+ it('for audio track', () => {
|
|
|
83
|
+ const audioSourceName = getSourceNameForJitsiTrack(endpointId, MediaType.AUDIO, 0);
|
|
|
84
|
+
|
|
|
85
|
+ // Audio track: muted
|
|
|
86
|
+ signalingLayer.setTrackMuteStatus(audioSourceName, true);
|
|
|
87
|
+ expect(chatRoom.addOrReplaceInPresence)
|
|
|
88
|
+ .toHaveBeenCalledWith(
|
|
|
89
|
+ SOURCE_INFO_PRESENCE_ELEMENT,
|
|
|
90
|
+ { value: `{"${audioSourceName}":{"muted":true}}` });
|
|
|
91
|
+
|
|
|
92
|
+ // Audio track: unmuted
|
|
|
93
|
+ signalingLayer.setTrackMuteStatus(audioSourceName, false);
|
|
|
94
|
+ expect(chatRoom.addOrReplaceInPresence)
|
|
|
95
|
+ .toHaveBeenCalledWith(
|
|
|
96
|
+ SOURCE_INFO_PRESENCE_ELEMENT,
|
|
|
97
|
+ { value: `{"${audioSourceName}":{"muted":false}}` });
|
|
|
98
|
+ });
|
|
|
99
|
+ it('for video track', () => {
|
|
|
100
|
+ const videoSourceName = getSourceNameForJitsiTrack(endpointId, MediaType.VIDEO, 0);
|
|
|
101
|
+
|
|
|
102
|
+ // Video track: muted
|
|
|
103
|
+ signalingLayer.setTrackMuteStatus(videoSourceName, true);
|
|
|
104
|
+ expect(chatRoom.addOrReplaceInPresence)
|
|
|
105
|
+ .toHaveBeenCalledWith(
|
|
|
106
|
+ SOURCE_INFO_PRESENCE_ELEMENT,
|
|
|
107
|
+ { value: `{"${videoSourceName}":{"muted":true}}` });
|
|
|
108
|
+
|
|
|
109
|
+ // Video track: unmuted
|
|
|
110
|
+ signalingLayer.setTrackMuteStatus(videoSourceName, false);
|
|
|
111
|
+ expect(chatRoom.addOrReplaceInPresence)
|
|
|
112
|
+ .toHaveBeenCalledWith(
|
|
|
113
|
+ SOURCE_INFO_PRESENCE_ELEMENT,
|
|
|
114
|
+ { value: `{"${videoSourceName}":{"muted":false}}` });
|
|
|
115
|
+ });
|
|
|
116
|
+ });
|
|
|
117
|
+ });
|
|
|
118
|
+ describe('setTrackVideoType', () => {
|
|
|
119
|
+ const endpointId = 'abcdef12';
|
|
|
120
|
+ let signalingLayer;
|
|
|
121
|
+ let chatRoom = createMockChatRoom();
|
|
|
122
|
+
|
|
|
123
|
+ beforeEach(() => {
|
|
|
124
|
+ FeatureFlags.init({ sourceNameSignaling: true });
|
|
|
125
|
+ signalingLayer = new SignalingLayerImpl();
|
|
|
126
|
+ chatRoom = createMockChatRoom();
|
|
|
127
|
+ signalingLayer.setChatRoom(chatRoom);
|
|
|
128
|
+
|
|
|
129
|
+ // Initial value is set in signalingLayer.setChatRoom
|
|
|
130
|
+ expect(chatRoom.addOrReplaceInPresence)
|
|
|
131
|
+ .toHaveBeenCalledWith(
|
|
|
132
|
+ SOURCE_INFO_PRESENCE_ELEMENT,
|
|
|
133
|
+ INITIAL_SOURCE_INFO);
|
|
|
134
|
+ });
|
|
|
135
|
+ it('sends video type in chat room presence', () => {
|
|
|
136
|
+ const videoSourceName = getSourceNameForJitsiTrack(endpointId, MediaType.VIDEO, 0);
|
|
|
137
|
+
|
|
|
138
|
+ signalingLayer.setTrackVideoType(videoSourceName, VideoType.CAMERA);
|
|
|
139
|
+ expect(chatRoom.addOrReplaceInPresence)
|
|
|
140
|
+ .toHaveBeenCalledWith(
|
|
|
141
|
+ SOURCE_INFO_PRESENCE_ELEMENT,
|
|
|
142
|
+ { value: '{"abcdef12-v0":{}}' });
|
|
|
143
|
+
|
|
|
144
|
+ signalingLayer.setTrackVideoType(videoSourceName, VideoType.DESKTOP);
|
|
|
145
|
+ expect(chatRoom.addOrReplaceInPresence)
|
|
|
146
|
+ .toHaveBeenCalledWith(
|
|
|
147
|
+ SOURCE_INFO_PRESENCE_ELEMENT,
|
|
|
148
|
+ { value: '{"abcdef12-v0":{"videoType":"desktop"}}' });
|
|
|
149
|
+
|
|
|
150
|
+ signalingLayer.setTrackVideoType(videoSourceName, VideoType.CAMERA);
|
|
|
151
|
+ expect(chatRoom.addOrReplaceInPresence)
|
|
|
152
|
+ .toHaveBeenCalledWith(
|
|
|
153
|
+ SOURCE_INFO_PRESENCE_ELEMENT,
|
|
|
154
|
+ { value: '{"abcdef12-v0":{}}' });
|
|
|
155
|
+ });
|
|
|
156
|
+ });
|
|
|
157
|
+ describe('should emit muted/video type events based on presence', () => {
|
|
|
158
|
+ describe('with: sourceNameSignaling: true', () => {
|
|
|
159
|
+ let signalingLayer;
|
|
|
160
|
+ let chatRoom = createMockChatRoom();
|
|
|
161
|
+
|
|
|
162
|
+ beforeEach(() => {
|
|
|
163
|
+ FeatureFlags.init({ sourceNameSignaling: true });
|
|
|
164
|
+ signalingLayer = new SignalingLayerImpl();
|
|
|
165
|
+ chatRoom = createMockChatRoom();
|
|
|
166
|
+ signalingLayer.setChatRoom(chatRoom);
|
|
|
167
|
+ });
|
|
|
168
|
+ it('from a legacy user (no SourceInfo)', () => {
|
|
|
169
|
+ const emitterSpy = spyOn(signalingLayer.eventEmitter, 'emit');
|
|
|
170
|
+
|
|
|
171
|
+ chatRoom.getLastPresence = () => [];
|
|
|
172
|
+ chatRoom.emitPresenceListener({
|
|
|
173
|
+ tagName: 'audiomuted',
|
|
|
174
|
+ value: 'true'
|
|
|
175
|
+ }, 'endpoint1');
|
|
|
176
|
+
|
|
|
177
|
+ expect(emitterSpy).toHaveBeenCalledWith(
|
|
|
178
|
+ SignalingEvents.PEER_MUTED_CHANGED,
|
|
|
179
|
+ 'endpoint1',
|
|
|
180
|
+ 'audio',
|
|
|
181
|
+ true
|
|
|
182
|
+ );
|
|
|
183
|
+ });
|
|
|
184
|
+ it('from a user with SourceInfo', () => {
|
|
|
185
|
+ const emitterSpy = spyOn(signalingLayer.eventEmitter, 'emit');
|
|
|
186
|
+ const sourceInfo = {
|
|
|
187
|
+ '12345678-a0': {
|
|
|
188
|
+ muted: true
|
|
|
189
|
+ }
|
|
|
190
|
+ };
|
|
|
191
|
+
|
|
|
192
|
+ chatRoom.mockSourceInfoPresence('endpoint1', sourceInfo);
|
|
|
193
|
+
|
|
|
194
|
+ // <audiomuted/> still included for backwards compat and ChatRoom will emit the presence event
|
|
|
195
|
+ chatRoom.emitPresenceListener({
|
|
|
196
|
+ tagName: 'audiomuted',
|
|
|
197
|
+ value: 'true'
|
|
|
198
|
+ }, 'endpoint1');
|
|
|
199
|
+
|
|
|
200
|
+ // Just once event though the legacy presence is there as well
|
|
|
201
|
+ expect(emitterSpy).toHaveBeenCalledTimes(1);
|
|
|
202
|
+ expect(emitterSpy).toHaveBeenCalledWith(
|
|
|
203
|
+ SignalingEvents.PEER_MUTED_CHANGED,
|
|
|
204
|
+ 'endpoint1',
|
|
|
205
|
+ 'audio',
|
|
|
206
|
+ true
|
|
|
207
|
+ );
|
|
|
208
|
+ });
|
|
|
209
|
+ });
|
|
|
210
|
+ describe('with: sourceNameSignaling: false', () => {
|
|
|
211
|
+ let signalingLayer;
|
|
|
212
|
+ let chatRoom;
|
|
|
213
|
+
|
|
|
214
|
+ beforeEach(() => {
|
|
|
215
|
+ FeatureFlags.init({ sourceNameSignaling: false });
|
|
|
216
|
+ signalingLayer = new SignalingLayerImpl();
|
|
|
217
|
+ chatRoom = createMockChatRoom();
|
|
|
218
|
+ signalingLayer.setChatRoom(chatRoom);
|
|
|
219
|
+ });
|
|
|
220
|
+ it('does not react to SourceInfo', () => {
|
|
|
221
|
+ const emitterSpy = spyOn(signalingLayer.eventEmitter, 'emit');
|
|
|
222
|
+ const sourceInfo = {
|
|
|
223
|
+ '12345678-a0': {
|
|
|
224
|
+ muted: true
|
|
|
225
|
+ }
|
|
|
226
|
+ };
|
|
|
227
|
+
|
|
|
228
|
+ chatRoom.mockSourceInfoPresence('endpoint1', sourceInfo);
|
|
|
229
|
+
|
|
|
230
|
+ expect(emitterSpy).not.toHaveBeenCalled();
|
|
|
231
|
+ });
|
|
|
232
|
+ });
|
|
|
233
|
+ });
|
|
|
234
|
+ describe('getPeerMediaInfo', () => {
|
|
|
235
|
+ describe('with: sourceNameSignaling: true', () => {
|
|
|
236
|
+ let signalingLayer;
|
|
|
237
|
+ let chatRoom;
|
|
|
238
|
+
|
|
|
239
|
+ beforeEach(() => {
|
|
|
240
|
+ FeatureFlags.init({ sourceNameSignaling: true });
|
|
|
241
|
+ signalingLayer = new SignalingLayerImpl();
|
|
|
242
|
+ chatRoom = createMockChatRoom();
|
|
|
243
|
+ signalingLayer.setChatRoom(chatRoom);
|
|
|
244
|
+ });
|
|
|
245
|
+ it('will provide default value if only empty source info was sent so far', () => {
|
|
|
246
|
+ const endpointId = '12345678';
|
|
|
247
|
+
|
|
|
248
|
+ chatRoom.mockSourceInfoPresence(endpointId, { });
|
|
|
249
|
+
|
|
|
250
|
+ const audioPeerMediaInfo = signalingLayer.getPeerMediaInfo(endpointId, MediaType.AUDIO);
|
|
|
251
|
+
|
|
|
252
|
+ expect(audioPeerMediaInfo).toEqual({ muted: true });
|
|
|
253
|
+
|
|
|
254
|
+ const videoPeerMediaInfo = signalingLayer.getPeerMediaInfo(endpointId, MediaType.VIDEO);
|
|
|
255
|
+
|
|
|
256
|
+ expect(videoPeerMediaInfo).toEqual({
|
|
|
257
|
+ muted: true,
|
|
|
258
|
+ videoType: undefined
|
|
|
259
|
+ });
|
|
|
260
|
+ });
|
|
|
261
|
+ describe('will read from SourceInfo if available', () => {
|
|
|
262
|
+ it('for audio', () => {
|
|
|
263
|
+ const endpointId = '12345678';
|
|
|
264
|
+ const sourceInfo = {
|
|
|
265
|
+ '12345678-a0': {
|
|
|
266
|
+ muted: true
|
|
|
267
|
+ }
|
|
|
268
|
+ };
|
|
|
269
|
+
|
|
|
270
|
+ chatRoom.mockSourceInfoPresence(endpointId, sourceInfo);
|
|
|
271
|
+
|
|
|
272
|
+ const peerMediaInfo = signalingLayer.getPeerMediaInfo(endpointId, MediaType.AUDIO);
|
|
|
273
|
+
|
|
|
274
|
+ expect(peerMediaInfo).toEqual({ muted: true });
|
|
|
275
|
+ });
|
|
|
276
|
+ it('for video', () => {
|
|
|
277
|
+ const endointId = '12345678';
|
|
|
278
|
+ const sourceInfo = {
|
|
|
279
|
+ '12345678-v0': {
|
|
|
280
|
+ muted: true,
|
|
|
281
|
+ videoType: 'desktop'
|
|
|
282
|
+ }
|
|
|
283
|
+ };
|
|
|
284
|
+
|
|
|
285
|
+ chatRoom.mockSourceInfoPresence(endointId, sourceInfo);
|
|
|
286
|
+
|
|
|
287
|
+ const peerMediaInfo = signalingLayer.getPeerMediaInfo(endointId, MediaType.VIDEO);
|
|
|
288
|
+
|
|
|
289
|
+ expect(peerMediaInfo).toEqual({
|
|
|
290
|
+ muted: true,
|
|
|
291
|
+ videoType: 'desktop'
|
|
|
292
|
+ });
|
|
|
293
|
+ });
|
|
|
294
|
+ });
|
|
|
295
|
+ describe('if there\'s no SourceInfo then will read from the legacy element', () => {
|
|
|
296
|
+ const endointId = '12345678';
|
|
|
297
|
+
|
|
|
298
|
+ it('for audio', () => {
|
|
|
299
|
+ // There's no 'SourceInfo' in the presence
|
|
|
300
|
+ chatRoom.getLastPresence = () => [ { } ];
|
|
|
301
|
+
|
|
|
302
|
+ // This test is very implementation specific and relies on the fact that the backwards compat logic
|
|
|
303
|
+ // is supposed to call into 'chatRoom.getMediaPresenceInfo' and return whatever it returns.
|
|
|
304
|
+ // To be removed once legacy signaling is deprecated.
|
|
|
305
|
+ chatRoom.getMediaPresenceInfo = () => {
|
|
|
306
|
+ return {
|
|
|
307
|
+ muted: true
|
|
|
308
|
+ };
|
|
|
309
|
+ };
|
|
|
310
|
+
|
|
|
311
|
+ const peerMediaInfo = signalingLayer.getPeerMediaInfo(endointId, MediaType.AUDIO);
|
|
|
312
|
+
|
|
|
313
|
+ expect(peerMediaInfo).toEqual({ muted: true });
|
|
|
314
|
+ });
|
|
|
315
|
+ it('for video', () => {
|
|
|
316
|
+ // There's no 'SourceInfo' in the presence
|
|
|
317
|
+ chatRoom.getLastPresence = () => [ { } ];
|
|
|
318
|
+
|
|
|
319
|
+ // This test is very implementation specific and relies on the fact that the backwards compat logic
|
|
|
320
|
+ // is supposed to call into 'chatRoom.getMediaPresenceInfo' and return whatever it returns.
|
|
|
321
|
+ // To be removed once legacy signaling is deprecated.
|
|
|
322
|
+ chatRoom.getMediaPresenceInfo = () => {
|
|
|
323
|
+ return {
|
|
|
324
|
+ muted: true,
|
|
|
325
|
+ videoType: 'desktop'
|
|
|
326
|
+ };
|
|
|
327
|
+ };
|
|
|
328
|
+
|
|
|
329
|
+ const peerMediaInfo = signalingLayer.getPeerMediaInfo(endointId, MediaType.VIDEO);
|
|
|
330
|
+
|
|
|
331
|
+ expect(peerMediaInfo).toEqual({
|
|
|
332
|
+ muted: true,
|
|
|
333
|
+ videoType: 'desktop'
|
|
|
334
|
+ });
|
|
|
335
|
+ });
|
|
|
336
|
+ });
|
|
|
337
|
+ });
|
|
|
338
|
+ describe('with: sourceNameSignaling: false', () => {
|
|
|
339
|
+ beforeEach(() => {
|
|
|
340
|
+ FeatureFlags.init({ sourceNameSignaling: false });
|
|
|
341
|
+ });
|
|
|
342
|
+ it('should not read from SourceInfo element', () => {
|
|
|
343
|
+ const signalingLayer = new SignalingLayerImpl();
|
|
|
344
|
+ const chatRoom = createMockChatRoom();
|
|
|
345
|
+
|
|
|
346
|
+ signalingLayer.setChatRoom(chatRoom);
|
|
|
347
|
+
|
|
|
348
|
+ const endointId = '12345678';
|
|
|
349
|
+ const sourceInfo = {
|
|
|
350
|
+ '12345678-v0': {
|
|
|
351
|
+ muted: true,
|
|
|
352
|
+ videoType: 'desktop'
|
|
|
353
|
+ }
|
|
|
354
|
+ };
|
|
|
355
|
+
|
|
|
356
|
+ chatRoom.mockSourceInfoPresence(endointId, sourceInfo);
|
|
|
357
|
+
|
|
|
358
|
+ // This is the value the legacy flow will use (the values are different that the SourceInfo one).
|
|
|
359
|
+ const legacyMediaInfoValue = {
|
|
|
360
|
+ muted: false,
|
|
|
361
|
+ videoType: 'camera'
|
|
|
362
|
+ };
|
|
|
363
|
+
|
|
|
364
|
+ chatRoom.getMediaPresenceInfo = () => legacyMediaInfoValue;
|
|
|
365
|
+
|
|
|
366
|
+ const peerMediaInfo = signalingLayer.getPeerMediaInfo(endointId, MediaType.VIDEO);
|
|
|
367
|
+
|
|
|
368
|
+ expect(peerMediaInfo).toEqual(legacyMediaInfoValue);
|
|
|
369
|
+ });
|
|
|
370
|
+ });
|
|
|
371
|
+ });
|
|
|
372
|
+ describe('will remove source info(cleanup corner cases)', () => {
|
|
|
373
|
+ let signalingLayer;
|
|
|
374
|
+ let chatRoom;
|
|
|
375
|
+ const endpointId = '12345678';
|
|
|
376
|
+
|
|
|
377
|
+ beforeEach(() => {
|
|
|
378
|
+ FeatureFlags.init({ sourceNameSignaling: true });
|
|
|
379
|
+
|
|
|
380
|
+ signalingLayer = new SignalingLayerImpl();
|
|
|
381
|
+ chatRoom = createMockChatRoom();
|
|
|
382
|
+
|
|
|
383
|
+ signalingLayer.setChatRoom(chatRoom);
|
|
|
384
|
+ });
|
|
|
385
|
+ it('when participant leaves', () => {
|
|
|
386
|
+ const sourceInfo = {
|
|
|
387
|
+ '12345678-v0': {
|
|
|
388
|
+ muted: false,
|
|
|
389
|
+ videoType: 'desktop'
|
|
|
390
|
+ }
|
|
|
391
|
+ };
|
|
|
392
|
+
|
|
|
393
|
+ chatRoom.mockSourceInfoPresence(endpointId, sourceInfo);
|
|
|
394
|
+
|
|
|
395
|
+ expect(signalingLayer.getPeerSourceInfo(endpointId, '12345678-v0')).toBeDefined();
|
|
|
396
|
+
|
|
|
397
|
+ chatRoom.emitParticipantLeft(endpointId);
|
|
|
398
|
+
|
|
|
399
|
+ expect(signalingLayer.getPeerSourceInfo(endpointId, '12345678-v0')).toBeUndefined();
|
|
|
400
|
+ });
|
|
|
401
|
+ it('when it\'s no longer in the presence', () => {
|
|
|
402
|
+ chatRoom.mockSourceInfoPresence(endpointId, {
|
|
|
403
|
+ '12345678-v0': { muted: false }
|
|
|
404
|
+ });
|
|
|
405
|
+
|
|
|
406
|
+ expect(signalingLayer.getPeerSourceInfo(endpointId, '12345678-v0')).toBeDefined();
|
|
|
407
|
+
|
|
|
408
|
+ chatRoom.mockSourceInfoPresence(endpointId, {
|
|
|
409
|
+ '12345678-v1': { muted: false }
|
|
|
410
|
+ });
|
|
|
411
|
+
|
|
|
412
|
+ expect(signalingLayer.getPeerSourceInfo(endpointId, '12345678-v0')).toBeUndefined();
|
|
|
413
|
+ expect(signalingLayer.getPeerSourceInfo(endpointId, '12345678-v1')).toBeDefined();
|
|
|
414
|
+ });
|
|
|
415
|
+ });
|
|
|
416
|
+});
|