@webex/plugin-meetings 3.0.0-beta.24 → 3.0.0-beta.241
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -8
- package/dist/annotation/annotation.types.js +7 -0
- package/dist/annotation/annotation.types.js.map +1 -0
- package/dist/annotation/constants.js +49 -0
- package/dist/annotation/constants.js.map +1 -0
- package/dist/annotation/index.js +342 -0
- package/dist/annotation/index.js.map +1 -0
- package/dist/breakouts/breakout.js +114 -14
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/edit-lock-error.js +52 -0
- package/dist/breakouts/edit-lock-error.js.map +1 -0
- package/dist/breakouts/events.js +45 -0
- package/dist/breakouts/events.js.map +1 -0
- package/dist/breakouts/index.js +841 -19
- package/dist/breakouts/index.js.map +1 -1
- package/dist/breakouts/request.js +78 -0
- package/dist/breakouts/request.js.map +1 -0
- package/dist/breakouts/utils.js +67 -0
- package/dist/breakouts/utils.js.map +1 -0
- package/dist/common/errors/webex-errors.js +28 -7
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/logs/logger-proxy.js +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/queue.js +24 -9
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +5 -10
- package/dist/config.js.map +1 -1
- package/dist/constants.js +190 -27
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +14 -0
- package/dist/controls-options-manager/constants.js.map +1 -0
- package/dist/controls-options-manager/enums.js +27 -0
- package/dist/controls-options-manager/enums.js.map +1 -0
- package/dist/controls-options-manager/index.js +297 -0
- package/dist/controls-options-manager/index.js.map +1 -0
- package/dist/controls-options-manager/types.js +7 -0
- package/dist/controls-options-manager/types.js.map +1 -0
- package/dist/controls-options-manager/util.js +319 -0
- package/dist/controls-options-manager/util.js.map +1 -0
- package/dist/index.js +106 -1
- package/dist/index.js.map +1 -1
- package/dist/interpretation/collection.js +23 -0
- package/dist/interpretation/collection.js.map +1 -0
- package/dist/interpretation/index.js +366 -0
- package/dist/interpretation/index.js.map +1 -0
- package/dist/interpretation/siLanguage.js +25 -0
- package/dist/interpretation/siLanguage.js.map +1 -0
- package/dist/locus-info/controlsUtils.js +91 -2
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +357 -62
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +7 -1
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +43 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +219 -63
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +89 -14
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +49 -106
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +29 -90
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +90 -2
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +2593 -2558
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +292 -0
- package/dist/meeting/locusMediaRequest.js.map +1 -0
- package/dist/meeting/muteState.js +228 -123
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +255 -195
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +601 -417
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/index.js +48 -7
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +171 -51
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/util.js +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +36 -36
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +22 -0
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +370 -90
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +7 -0
- package/dist/meetings/meetings.types.js.map +1 -0
- package/dist/meetings/request.js +2 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +88 -1
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +49 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js +25 -0
- package/dist/member/types.js.map +1 -0
- package/dist/member/util.js +121 -25
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +10 -0
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +86 -5
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +106 -38
- package/dist/members/request.js.map +1 -1
- package/dist/members/types.js +15 -0
- package/dist/members/types.js.map +1 -0
- package/dist/members/util.js +316 -233
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +4 -5
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +1 -468
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +238 -49
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +49 -16
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +52 -34
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +44 -18
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +60 -3
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +213 -62
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/reachability/index.js +81 -30
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +16 -7
- package/dist/reachability/request.js.map +1 -1
- package/dist/reconnection-manager/index.js +199 -154
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/index.js +21 -2
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/recording-controller/util.js +9 -8
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/roap/index.js +23 -29
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +112 -89
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +96 -36
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/rtcMetrics/constants.js +12 -0
- package/dist/rtcMetrics/constants.js.map +1 -0
- package/dist/rtcMetrics/index.js +117 -0
- package/dist/rtcMetrics/index.js.map +1 -0
- package/dist/statsAnalyzer/index.js +51 -34
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +6 -6
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/types/annotation/annotation.types.d.ts +42 -0
- package/dist/types/annotation/constants.d.ts +31 -0
- package/dist/types/annotation/index.d.ts +117 -0
- package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
- package/dist/types/breakouts/events.d.ts +8 -0
- package/dist/types/breakouts/request.d.ts +22 -0
- package/dist/types/breakouts/utils.d.ts +15 -0
- package/dist/types/common/errors/webex-errors.d.ts +13 -1
- package/dist/types/common/queue.d.ts +9 -7
- package/dist/types/config.d.ts +1 -6
- package/dist/types/constants.d.ts +154 -21
- package/dist/types/controls-options-manager/constants.d.ts +4 -0
- package/dist/types/controls-options-manager/enums.d.ts +15 -0
- package/dist/types/controls-options-manager/index.d.ts +136 -0
- package/dist/types/controls-options-manager/types.d.ts +43 -0
- package/dist/types/controls-options-manager/util.d.ts +1 -0
- package/dist/types/index.d.ts +6 -4
- package/dist/types/interpretation/collection.d.ts +5 -0
- package/dist/types/interpretation/index.d.ts +5 -0
- package/dist/types/interpretation/siLanguage.d.ts +5 -0
- package/dist/types/locus-info/index.d.ts +57 -4
- package/dist/types/locus-info/parser.d.ts +65 -6
- package/dist/types/media/index.d.ts +2 -0
- package/dist/types/media/properties.d.ts +22 -36
- package/dist/types/meeting/in-meeting-actions.d.ts +90 -2
- package/dist/types/meeting/index.d.ts +297 -491
- package/dist/types/meeting/locusMediaRequest.d.ts +74 -0
- package/dist/types/meeting/muteState.d.ts +98 -22
- package/dist/types/meeting/request.d.ts +72 -43
- package/dist/types/meeting/util.d.ts +101 -1
- package/dist/types/meeting-info/index.d.ts +6 -1
- package/dist/types/meeting-info/meeting-info-v2.d.ts +30 -1
- package/dist/types/meetings/collection.d.ts +8 -0
- package/dist/types/meetings/index.d.ts +76 -12
- package/dist/types/meetings/meetings.types.d.ts +4 -0
- package/dist/types/member/index.d.ts +13 -0
- package/dist/types/member/types.d.ts +32 -0
- package/dist/types/members/collection.d.ts +5 -0
- package/dist/types/members/index.d.ts +35 -2
- package/dist/types/members/request.d.ts +73 -9
- package/dist/types/members/types.d.ts +24 -0
- package/dist/types/members/util.d.ts +209 -1
- package/dist/types/metrics/constants.d.ts +3 -4
- package/dist/types/metrics/index.d.ts +4 -119
- package/dist/types/multistream/mediaRequestManager.d.ts +73 -5
- package/dist/types/multistream/receiveSlot.d.ts +16 -12
- package/dist/types/multistream/receiveSlotManager.d.ts +19 -4
- package/dist/types/multistream/remoteMedia.d.ts +8 -29
- package/dist/types/multistream/remoteMediaGroup.d.ts +0 -9
- package/dist/types/multistream/remoteMediaManager.d.ts +46 -2
- package/dist/types/reachability/index.d.ts +15 -3
- package/dist/types/reachability/request.d.ts +7 -3
- package/dist/types/reconnection-manager/index.d.ts +9 -0
- package/dist/types/recording-controller/index.d.ts +15 -1
- package/dist/types/recording-controller/util.d.ts +5 -4
- package/dist/types/roap/request.d.ts +15 -11
- package/dist/types/roap/turnDiscovery.d.ts +18 -1
- package/dist/types/rtcMetrics/constants.d.ts +4 -0
- package/dist/types/rtcMetrics/index.d.ts +47 -0
- package/dist/types/statsAnalyzer/index.d.ts +6 -1
- package/package.json +23 -20
- package/src/annotation/annotation.types.ts +50 -0
- package/src/annotation/constants.ts +36 -0
- package/src/annotation/index.ts +328 -0
- package/src/breakouts/README.md +44 -14
- package/src/breakouts/breakout.ts +87 -9
- package/src/breakouts/edit-lock-error.ts +25 -0
- package/src/breakouts/events.ts +56 -0
- package/src/breakouts/index.ts +710 -10
- package/src/breakouts/request.ts +55 -0
- package/src/breakouts/utils.ts +57 -0
- package/src/common/errors/webex-errors.ts +27 -2
- package/src/common/logs/logger-proxy.ts +1 -1
- package/src/common/queue.ts +22 -8
- package/src/config.ts +4 -9
- package/src/constants.ts +175 -18
- package/src/controls-options-manager/constants.ts +5 -0
- package/src/controls-options-manager/enums.ts +18 -0
- package/src/controls-options-manager/index.ts +278 -0
- package/src/controls-options-manager/types.ts +59 -0
- package/src/controls-options-manager/util.ts +300 -0
- package/src/index.ts +39 -0
- package/src/interpretation/README.md +60 -0
- package/src/interpretation/collection.ts +19 -0
- package/src/interpretation/index.ts +332 -0
- package/src/interpretation/siLanguage.ts +18 -0
- package/src/locus-info/controlsUtils.ts +108 -0
- package/src/locus-info/index.ts +381 -59
- package/src/locus-info/infoUtils.ts +10 -2
- package/src/locus-info/mediaSharesUtils.ts +48 -0
- package/src/locus-info/parser.ts +224 -39
- package/src/locus-info/selfUtils.ts +81 -5
- package/src/media/index.ts +89 -109
- package/src/media/properties.ts +48 -87
- package/src/meeting/in-meeting-actions.ts +179 -3
- package/src/meeting/index.ts +2086 -2151
- package/src/meeting/locusMediaRequest.ts +313 -0
- package/src/meeting/muteState.ts +227 -130
- package/src/meeting/request.ts +171 -120
- package/src/meeting/util.ts +588 -395
- package/src/meeting-info/index.ts +54 -8
- package/src/meeting-info/meeting-info-v2.ts +148 -14
- package/src/meeting-info/util.ts +1 -1
- package/src/meeting-info/utilv2.ts +23 -23
- package/src/meetings/collection.ts +20 -0
- package/src/meetings/index.ts +407 -108
- package/src/meetings/meetings.types.ts +12 -0
- package/src/meetings/request.ts +2 -0
- package/src/meetings/util.ts +103 -4
- package/src/member/index.ts +49 -0
- package/src/member/types.ts +38 -0
- package/src/member/util.ts +127 -25
- package/src/members/collection.ts +8 -0
- package/src/members/index.ts +107 -6
- package/src/members/request.ts +97 -17
- package/src/members/types.ts +28 -0
- package/src/members/util.ts +319 -240
- package/src/metrics/constants.ts +3 -4
- package/src/metrics/index.ts +1 -490
- package/src/multistream/mediaRequestManager.ts +289 -79
- package/src/multistream/receiveSlot.ts +55 -18
- package/src/multistream/receiveSlotManager.ts +46 -24
- package/src/multistream/remoteMedia.ts +27 -2
- package/src/multistream/remoteMediaGroup.ts +59 -0
- package/src/multistream/remoteMediaManager.ts +150 -32
- package/src/reachability/index.ts +69 -17
- package/src/reachability/request.ts +16 -7
- package/src/reconnection-manager/index.ts +81 -54
- package/src/recording-controller/index.ts +20 -3
- package/src/recording-controller/util.ts +26 -9
- package/src/roap/index.ts +23 -30
- package/src/roap/request.ts +104 -95
- package/src/roap/turnDiscovery.ts +50 -25
- package/src/rtcMetrics/constants.ts +3 -0
- package/src/rtcMetrics/index.ts +100 -0
- package/src/statsAnalyzer/index.ts +73 -35
- package/src/statsAnalyzer/mqaUtil.ts +8 -10
- package/test/integration/spec/converged-space-meetings.js +233 -0
- package/test/integration/spec/journey.js +336 -259
- package/test/integration/spec/space-meeting.js +76 -3
- package/test/unit/spec/annotation/index.ts +418 -0
- package/test/unit/spec/breakouts/breakout.ts +142 -24
- package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
- package/test/unit/spec/breakouts/events.ts +89 -0
- package/test/unit/spec/breakouts/index.ts +1545 -48
- package/test/unit/spec/breakouts/request.ts +104 -0
- package/test/unit/spec/breakouts/utils.js +72 -0
- package/test/unit/spec/common/queue.js +31 -2
- package/test/unit/spec/controls-options-manager/index.js +287 -0
- package/test/unit/spec/controls-options-manager/util.js +582 -0
- package/test/unit/spec/fixture/locus.js +1 -0
- package/test/unit/spec/interpretation/collection.ts +15 -0
- package/test/unit/spec/interpretation/index.ts +589 -0
- package/test/unit/spec/interpretation/siLanguage.ts +28 -0
- package/test/unit/spec/locus-info/controlsUtils.js +316 -43
- package/test/unit/spec/locus-info/index.js +1169 -36
- package/test/unit/spec/locus-info/infoUtils.js +37 -15
- package/test/unit/spec/locus-info/mediaSharesUtils.ts +22 -0
- package/test/unit/spec/locus-info/parser.js +62 -22
- package/test/unit/spec/locus-info/selfConstant.js +27 -4
- package/test/unit/spec/locus-info/selfUtils.js +208 -17
- package/test/unit/spec/media/index.ts +138 -28
- package/test/unit/spec/meeting/in-meeting-actions.ts +89 -3
- package/test/unit/spec/meeting/index.js +3514 -1746
- package/test/unit/spec/meeting/locusMediaRequest.ts +442 -0
- package/test/unit/spec/meeting/muteState.js +370 -208
- package/test/unit/spec/meeting/request.js +440 -45
- package/test/unit/spec/meeting/utils.js +671 -54
- package/test/unit/spec/meeting-info/index.js +181 -0
- package/test/unit/spec/meeting-info/meetinginfov2.js +383 -5
- package/test/unit/spec/meeting-info/utilv2.js +21 -0
- package/test/unit/spec/meetings/collection.js +14 -0
- package/test/unit/spec/meetings/index.js +939 -150
- package/test/unit/spec/meetings/utils.js +206 -2
- package/test/unit/spec/member/index.js +58 -4
- package/test/unit/spec/member/util.js +479 -35
- package/test/unit/spec/members/index.js +319 -1
- package/test/unit/spec/members/request.js +206 -27
- package/test/unit/spec/members/utils.js +184 -0
- package/test/unit/spec/metrics/index.js +1 -50
- package/test/unit/spec/multistream/mediaRequestManager.ts +803 -162
- package/test/unit/spec/multistream/receiveSlot.ts +72 -13
- package/test/unit/spec/multistream/receiveSlotManager.ts +58 -28
- package/test/unit/spec/multistream/remoteMedia.ts +30 -0
- package/test/unit/spec/multistream/remoteMediaGroup.ts +266 -0
- package/test/unit/spec/multistream/remoteMediaManager.ts +326 -0
- package/test/unit/spec/reachability/index.ts +185 -7
- package/test/unit/spec/reachability/request.js +68 -0
- package/test/unit/spec/reconnection-manager/index.js +80 -6
- package/test/unit/spec/recording-controller/index.js +294 -218
- package/test/unit/spec/recording-controller/util.js +223 -96
- package/test/unit/spec/roap/index.ts +31 -51
- package/test/unit/spec/roap/request.ts +202 -85
- package/test/unit/spec/roap/turnDiscovery.ts +45 -10
- package/test/unit/spec/rtcMetrics/index.ts +68 -0
- package/test/unit/spec/stats-analyzer/index.js +29 -2
- package/test/utils/constants.js +9 -0
- package/test/utils/integrationTestUtils.js +46 -0
- package/test/utils/testUtils.js +0 -45
- package/test/utils/webex-config.js +4 -0
- package/test/utils/webex-test-users.js +6 -3
- package/dist/meeting/effectsState.js +0 -262
- package/dist/meeting/effectsState.js.map +0 -1
- package/dist/metrics/config.js +0 -299
- package/dist/metrics/config.js.map +0 -1
- package/dist/types/meeting/effectsState.d.ts +0 -42
- package/dist/types/metrics/config.d.ts +0 -178
- package/src/index.js +0 -16
- package/src/meeting/effectsState.ts +0 -211
- package/src/metrics/config.ts +0 -495
- package/test/unit/spec/meeting/effectsState.js +0 -285
|
@@ -15,6 +15,9 @@ import {cloneDeep} from 'lodash';
|
|
|
15
15
|
import {MediaRequest} from '@webex/plugin-meetings/src/multistream/mediaRequestManager';
|
|
16
16
|
import {CSI, ReceiveSlotId} from '@webex/plugin-meetings/src/multistream/receiveSlot';
|
|
17
17
|
import testUtils from '../../../utils/testUtils';
|
|
18
|
+
import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
|
|
19
|
+
import LoggerConfig from '@webex/plugin-meetings/src/common/logs/logger-config';
|
|
20
|
+
import { expect } from 'chai';
|
|
18
21
|
|
|
19
22
|
class FakeSlot extends EventEmitter {
|
|
20
23
|
public mediaType: MediaType;
|
|
@@ -32,6 +35,10 @@ class FakeSlot extends EventEmitter {
|
|
|
32
35
|
// Calling setMaxListeners() fixes the warning.
|
|
33
36
|
this.setMaxListeners(50);
|
|
34
37
|
}
|
|
38
|
+
|
|
39
|
+
public get logString() {
|
|
40
|
+
return this.id;
|
|
41
|
+
}
|
|
35
42
|
}
|
|
36
43
|
|
|
37
44
|
const DefaultTestConfiguration: Configuration = {
|
|
@@ -120,7 +127,23 @@ describe('RemoteMediaManager', () => {
|
|
|
120
127
|
let fakeScreenShareAudioSlot;
|
|
121
128
|
let fakeScreenShareVideoSlot;
|
|
122
129
|
|
|
130
|
+
const logger = {
|
|
131
|
+
log: sinon.fake(),
|
|
132
|
+
error: () => {},
|
|
133
|
+
warn: () => {},
|
|
134
|
+
trace: () => {},
|
|
135
|
+
debug: () => {},
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
afterEach(() => {
|
|
139
|
+
LoggerConfig.set({enable: false});
|
|
140
|
+
LoggerProxy.set();
|
|
141
|
+
});
|
|
142
|
+
|
|
123
143
|
beforeEach(() => {
|
|
144
|
+
LoggerConfig.set({enable: true});
|
|
145
|
+
LoggerProxy.set(logger);
|
|
146
|
+
|
|
124
147
|
fakeAudioSlot = new FakeSlot(MediaType.AudioMain, 'fake audio slot');
|
|
125
148
|
fakeVideoSlot = new FakeSlot(MediaType.VideoMain, 'fake video slot');
|
|
126
149
|
fakeScreenShareAudioSlot = new FakeSlot(
|
|
@@ -191,6 +214,7 @@ describe('RemoteMediaManager', () => {
|
|
|
191
214
|
fakeMediaRequestManagers.video.commit.resetHistory();
|
|
192
215
|
fakeMediaRequestManagers.screenShareVideo.commit.resetHistory();
|
|
193
216
|
fakeMediaRequestManagers.screenShareAudio.commit.resetHistory();
|
|
217
|
+
logger.log.resetHistory();
|
|
194
218
|
};
|
|
195
219
|
|
|
196
220
|
describe('start', () => {
|
|
@@ -639,6 +663,41 @@ describe('RemoteMediaManager', () => {
|
|
|
639
663
|
remoteMediaManager.stop();
|
|
640
664
|
});
|
|
641
665
|
});
|
|
666
|
+
|
|
667
|
+
describe('setPreferLiveVideo', () => {
|
|
668
|
+
|
|
669
|
+
it('sets preferLiveVideo', async () => {
|
|
670
|
+
const config = cloneDeep(DefaultTestConfiguration);
|
|
671
|
+
let stubs = [];
|
|
672
|
+
|
|
673
|
+
config.video.initialLayoutId = 'OnePlusFive';
|
|
674
|
+
|
|
675
|
+
remoteMediaManager = new RemoteMediaManager(
|
|
676
|
+
fakeReceiveSlotManager,
|
|
677
|
+
fakeMediaRequestManagers,
|
|
678
|
+
config
|
|
679
|
+
);
|
|
680
|
+
|
|
681
|
+
remoteMediaManager.on(Event.VideoLayoutChanged, (layoutInfo: VideoLayoutChangedEventData) => {
|
|
682
|
+
Object.values(layoutInfo.activeSpeakerVideoPanes).forEach((group) => stubs.push(sinon.stub(group, 'setPreferLiveVideo')));
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
await remoteMediaManager.start();
|
|
686
|
+
resetHistory();
|
|
687
|
+
assert(stubs.length > 0);
|
|
688
|
+
await remoteMediaManager.setPreferLiveVideo(true);
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
stubs.forEach((stub) => {
|
|
692
|
+
assert.calledWith(stub, true, false)
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
expect(config.video.preferLiveVideo).to.equal(true);
|
|
696
|
+
|
|
697
|
+
assert.calledOnce(fakeMediaRequestManagers.video.commit);
|
|
698
|
+
});
|
|
699
|
+
});
|
|
700
|
+
|
|
642
701
|
describe('setLayout', () => {
|
|
643
702
|
it('rejects if called with invalid layoutId', async () => {
|
|
644
703
|
await assert.isRejected(remoteMediaManager.setLayout('invalid value'));
|
|
@@ -671,6 +730,58 @@ describe('RemoteMediaManager', () => {
|
|
|
671
730
|
assert.alwaysCalledWith(fakeReceiveSlotManager.allocateSlot, MediaType.VideoMain);
|
|
672
731
|
});
|
|
673
732
|
|
|
733
|
+
it('logs layout changes - receiver selected', async () => {
|
|
734
|
+
const config = cloneDeep(DefaultTestConfiguration);
|
|
735
|
+
|
|
736
|
+
remoteMediaManager = new RemoteMediaManager(
|
|
737
|
+
fakeReceiveSlotManager,
|
|
738
|
+
fakeMediaRequestManagers,
|
|
739
|
+
config
|
|
740
|
+
);
|
|
741
|
+
|
|
742
|
+
await remoteMediaManager.start();
|
|
743
|
+
|
|
744
|
+
resetHistory();
|
|
745
|
+
|
|
746
|
+
await remoteMediaManager.setLayout('Stage');
|
|
747
|
+
|
|
748
|
+
assert.calledWith(
|
|
749
|
+
logger.log,
|
|
750
|
+
'RemoteMediaManager#setLayout --> new layout selected: Stage'
|
|
751
|
+
);
|
|
752
|
+
assert.calledWith(
|
|
753
|
+
logger.log,
|
|
754
|
+
'RemoteMediaManager#logMainVideoReceiveSlots --> MAIN VIDEO receive slots: unused=0, activeSpeaker=6, receiverSelected=4\ngroup: thumbnails\nfake video slot, fake video slot, fake video slot, fake video slot, fake video slot, fake video slot\nreceiverSelected:\n stage-1: fake video slot\n stage-2: fake video slot\n stage-3: fake video slot\n stage-4: fake video slot\n'
|
|
755
|
+
);
|
|
756
|
+
});
|
|
757
|
+
|
|
758
|
+
it('logs layout changes - active speaker', async () => {
|
|
759
|
+
const config = cloneDeep(DefaultTestConfiguration);
|
|
760
|
+
config.video.initialLayoutId = 'OnePlusFive'
|
|
761
|
+
|
|
762
|
+
remoteMediaManager = new RemoteMediaManager(
|
|
763
|
+
fakeReceiveSlotManager,
|
|
764
|
+
fakeMediaRequestManagers,
|
|
765
|
+
config
|
|
766
|
+
);
|
|
767
|
+
|
|
768
|
+
await remoteMediaManager.start();
|
|
769
|
+
|
|
770
|
+
resetHistory();
|
|
771
|
+
|
|
772
|
+
await remoteMediaManager.setLayout('AllEqual');
|
|
773
|
+
|
|
774
|
+
assert.calledWith(
|
|
775
|
+
logger.log,
|
|
776
|
+
'RemoteMediaManager#setLayout --> new layout selected: AllEqual'
|
|
777
|
+
);
|
|
778
|
+
assert.calledWith(
|
|
779
|
+
logger.log,
|
|
780
|
+
'RemoteMediaManager#logMainVideoReceiveSlots --> MAIN VIDEO receive slots: unused=0, activeSpeaker=9, receiverSelected=0\ngroup: main\nfake video slot, fake video slot, fake video slot, fake video slot, fake video slot, fake video slot, fake video slot, fake video slot, fake video slot\nreceiverSelected:\n'
|
|
781
|
+
);
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
|
|
674
785
|
it('releases slots when switching to layout that requires less active speaker slots', async () => {
|
|
675
786
|
// start with "AllEqual" layout that needs just 9 video slots
|
|
676
787
|
const config = cloneDeep(DefaultTestConfiguration);
|
|
@@ -699,6 +810,133 @@ describe('RemoteMediaManager', () => {
|
|
|
699
810
|
});
|
|
700
811
|
});
|
|
701
812
|
|
|
813
|
+
it('releases slots and reallocates slots when switching to layouts in correct order', async () => {
|
|
814
|
+
|
|
815
|
+
const config = cloneDeep(DefaultTestConfiguration);
|
|
816
|
+
let count = 0;
|
|
817
|
+
|
|
818
|
+
fakeReceiveSlotManager.allocateSlot = sinon.stub().callsFake((mediaType) => {
|
|
819
|
+
switch (mediaType) {
|
|
820
|
+
case MediaType.AudioMain:
|
|
821
|
+
return Promise.resolve(fakeAudioSlot);
|
|
822
|
+
case MediaType.VideoMain:
|
|
823
|
+
return Promise.resolve(new FakeSlot(MediaType.VideoMain, `fake video ${count++}`));
|
|
824
|
+
case MediaType.AudioSlides:
|
|
825
|
+
return Promise.resolve(fakeScreenShareAudioSlot);
|
|
826
|
+
case MediaType.VideoSlides:
|
|
827
|
+
return Promise.resolve(fakeScreenShareVideoSlot);
|
|
828
|
+
}
|
|
829
|
+
throw new Error(`invalid mediaType: ${mediaType}`);
|
|
830
|
+
})
|
|
831
|
+
|
|
832
|
+
remoteMediaManager = new RemoteMediaManager(
|
|
833
|
+
fakeReceiveSlotManager,
|
|
834
|
+
fakeMediaRequestManagers,
|
|
835
|
+
config
|
|
836
|
+
);
|
|
837
|
+
|
|
838
|
+
await remoteMediaManager.start();
|
|
839
|
+
|
|
840
|
+
resetHistory();
|
|
841
|
+
|
|
842
|
+
assert.deepEqual(remoteMediaManager.slots.video.activeSpeaker.map((slot: any) => slot.id), [
|
|
843
|
+
"fake video 0",
|
|
844
|
+
"fake video 1",
|
|
845
|
+
"fake video 2",
|
|
846
|
+
"fake video 3",
|
|
847
|
+
"fake video 4",
|
|
848
|
+
"fake video 5",
|
|
849
|
+
"fake video 6",
|
|
850
|
+
"fake video 7",
|
|
851
|
+
"fake video 8",
|
|
852
|
+
]);
|
|
853
|
+
|
|
854
|
+
assert.deepEqual(remoteMediaManager.receiveSlotAllocations.activeSpeaker["main"].slots.map((slot: any) => slot.id), [
|
|
855
|
+
"fake video 0",
|
|
856
|
+
"fake video 1",
|
|
857
|
+
"fake video 2",
|
|
858
|
+
"fake video 3",
|
|
859
|
+
"fake video 4",
|
|
860
|
+
"fake video 5",
|
|
861
|
+
"fake video 6",
|
|
862
|
+
"fake video 7",
|
|
863
|
+
"fake video 8",
|
|
864
|
+
])
|
|
865
|
+
|
|
866
|
+
// switch to "OnePlusFive" layout that requires 3 less video slots (6)
|
|
867
|
+
await remoteMediaManager.setLayout('OnePlusFive');
|
|
868
|
+
|
|
869
|
+
assert.deepEqual(remoteMediaManager.slots.video.unused, []);
|
|
870
|
+
|
|
871
|
+
assert.deepEqual(remoteMediaManager.slots.video.activeSpeaker.map((slot: any) => slot.id), [
|
|
872
|
+
"fake video 0",
|
|
873
|
+
"fake video 1",
|
|
874
|
+
"fake video 2",
|
|
875
|
+
"fake video 3",
|
|
876
|
+
"fake video 4",
|
|
877
|
+
"fake video 5"
|
|
878
|
+
]);
|
|
879
|
+
|
|
880
|
+
// we're checking that the slots are in the same order as in the previous layout
|
|
881
|
+
// first one goes into main
|
|
882
|
+
assert.deepEqual(remoteMediaManager.receiveSlotAllocations.activeSpeaker["mainBigOne"].slots.map((slot: any) => slot.id), [
|
|
883
|
+
"fake video 0",
|
|
884
|
+
])
|
|
885
|
+
// and rest go in the pips
|
|
886
|
+
assert.deepEqual(remoteMediaManager.receiveSlotAllocations.activeSpeaker["secondarySetOfSmallPanes"].slots.map((slot: any) => slot.id), [
|
|
887
|
+
"fake video 1",
|
|
888
|
+
"fake video 2",
|
|
889
|
+
"fake video 3",
|
|
890
|
+
"fake video 4",
|
|
891
|
+
"fake video 5"
|
|
892
|
+
])
|
|
893
|
+
|
|
894
|
+
// verify that 3 main video slots were released
|
|
895
|
+
assert.callCount(fakeReceiveSlotManager.releaseSlot, 3);
|
|
896
|
+
fakeReceiveSlotManager.releaseSlot.getCalls().forEach((call) => {
|
|
897
|
+
const slot = call.args[0];
|
|
898
|
+
|
|
899
|
+
assert.strictEqual(slot.mediaType, MediaType.VideoMain);
|
|
900
|
+
});
|
|
901
|
+
|
|
902
|
+
await remoteMediaManager.setLayout('AllEqual');
|
|
903
|
+
|
|
904
|
+
assert.deepEqual(remoteMediaManager.slots.video.unused, []);
|
|
905
|
+
|
|
906
|
+
// checking that slots are in the same order as in previous layout + 3 new ones
|
|
907
|
+
assert.deepEqual(remoteMediaManager.slots.video.activeSpeaker.map((slot: any) => slot.id), [
|
|
908
|
+
"fake video 0",
|
|
909
|
+
"fake video 1",
|
|
910
|
+
"fake video 2",
|
|
911
|
+
"fake video 3",
|
|
912
|
+
"fake video 4",
|
|
913
|
+
"fake video 5",
|
|
914
|
+
"fake video 10",
|
|
915
|
+
"fake video 11",
|
|
916
|
+
"fake video 12",
|
|
917
|
+
]);
|
|
918
|
+
|
|
919
|
+
assert.deepEqual(remoteMediaManager.receiveSlotAllocations.activeSpeaker["main"].slots.map((slot: any) => slot.id), [
|
|
920
|
+
"fake video 0",
|
|
921
|
+
"fake video 1",
|
|
922
|
+
"fake video 2",
|
|
923
|
+
"fake video 3",
|
|
924
|
+
"fake video 4",
|
|
925
|
+
"fake video 5",
|
|
926
|
+
"fake video 10",
|
|
927
|
+
"fake video 11",
|
|
928
|
+
"fake video 12"
|
|
929
|
+
])
|
|
930
|
+
|
|
931
|
+
// verify that 3 main video slots were allocated
|
|
932
|
+
assert.callCount(fakeReceiveSlotManager.allocateSlot, 3);
|
|
933
|
+
fakeReceiveSlotManager.allocateSlot.getCalls().forEach((call) => {
|
|
934
|
+
const mediaType = call.args[0];
|
|
935
|
+
|
|
936
|
+
assert.strictEqual(mediaType, MediaType.VideoMain);
|
|
937
|
+
});
|
|
938
|
+
});
|
|
939
|
+
|
|
702
940
|
it('stops all current video remoteMedia instances when switching to new layout', async () => {
|
|
703
941
|
const audioStopStubs = [];
|
|
704
942
|
const videoStopStubs = [];
|
|
@@ -1494,6 +1732,94 @@ describe('RemoteMediaManager', () => {
|
|
|
1494
1732
|
});
|
|
1495
1733
|
});
|
|
1496
1734
|
|
|
1735
|
+
describe('setActiveSpeakerCsis', () => {
|
|
1736
|
+
it('calls setActiveSpeakerCsis on the correct remote media group', async () => {
|
|
1737
|
+
let currentLayoutInfo: VideoLayoutChangedEventData | null = null;
|
|
1738
|
+
let setCsisStub;
|
|
1739
|
+
|
|
1740
|
+
remoteMediaManager.on(Event.VideoLayoutChanged, (layoutInfo: VideoLayoutChangedEventData) => {
|
|
1741
|
+
currentLayoutInfo = layoutInfo;
|
|
1742
|
+
setCsisStub = sinon.stub(layoutInfo.activeSpeakerVideoPanes.main, 'setActiveSpeakerCsis');
|
|
1743
|
+
});
|
|
1744
|
+
|
|
1745
|
+
await remoteMediaManager.start();
|
|
1746
|
+
resetHistory();
|
|
1747
|
+
|
|
1748
|
+
assert.isNotNull(currentLayoutInfo);
|
|
1749
|
+
|
|
1750
|
+
if (currentLayoutInfo) {
|
|
1751
|
+
const remoteVideo = currentLayoutInfo.activeSpeakerVideoPanes.main.getRemoteMedia()[0];
|
|
1752
|
+
|
|
1753
|
+
remoteMediaManager.setActiveSpeakerCsis([{remoteMedia: remoteVideo}]);
|
|
1754
|
+
|
|
1755
|
+
assert.calledOnce(setCsisStub);
|
|
1756
|
+
assert.calledWith(setCsisStub, [{remoteMedia: remoteVideo}], false);
|
|
1757
|
+
assert.calledOnce(fakeMediaRequestManagers.video.commit);
|
|
1758
|
+
}
|
|
1759
|
+
});
|
|
1760
|
+
|
|
1761
|
+
it('does not call setActiveSpeakerCsis on the incorrect media group', async () => {
|
|
1762
|
+
let currentLayoutInfo: VideoLayoutChangedEventData | null = null;
|
|
1763
|
+
let setCsisStub;
|
|
1764
|
+
|
|
1765
|
+
remoteMediaManager.on(Event.VideoLayoutChanged, (layoutInfo: VideoLayoutChangedEventData) => {
|
|
1766
|
+
currentLayoutInfo = layoutInfo;
|
|
1767
|
+
setCsisStub = sinon.stub(layoutInfo.activeSpeakerVideoPanes.main, 'setActiveSpeakerCsis');
|
|
1768
|
+
});
|
|
1769
|
+
|
|
1770
|
+
await remoteMediaManager.start();
|
|
1771
|
+
resetHistory();
|
|
1772
|
+
|
|
1773
|
+
assert.isNotNull(currentLayoutInfo);
|
|
1774
|
+
|
|
1775
|
+
if (currentLayoutInfo) {
|
|
1776
|
+
remoteMediaManager.setActiveSpeakerCsis([{remoteMedia: {}}]);
|
|
1777
|
+
|
|
1778
|
+
assert.notCalled(setCsisStub);
|
|
1779
|
+
assert.calledOnce(fakeMediaRequestManagers.video.commit);
|
|
1780
|
+
}
|
|
1781
|
+
});
|
|
1782
|
+
|
|
1783
|
+
it('checking when there is more than one group', async () => {
|
|
1784
|
+
let currentLayoutInfo: VideoLayoutChangedEventData | null = null;
|
|
1785
|
+
const config = cloneDeep(DefaultTestConfiguration);
|
|
1786
|
+
let stubs = [];
|
|
1787
|
+
|
|
1788
|
+
config.video.initialLayoutId = 'OnePlusFive';
|
|
1789
|
+
|
|
1790
|
+
remoteMediaManager = new RemoteMediaManager(
|
|
1791
|
+
fakeReceiveSlotManager,
|
|
1792
|
+
fakeMediaRequestManagers,
|
|
1793
|
+
config
|
|
1794
|
+
);
|
|
1795
|
+
|
|
1796
|
+
remoteMediaManager.on(Event.VideoLayoutChanged, (layoutInfo: VideoLayoutChangedEventData) => {
|
|
1797
|
+
currentLayoutInfo = layoutInfo;
|
|
1798
|
+
Object.values(layoutInfo.activeSpeakerVideoPanes).forEach((group) => stubs.push(sinon.stub(group, 'setActiveSpeakerCsis')));
|
|
1799
|
+
});
|
|
1800
|
+
|
|
1801
|
+
await remoteMediaManager.start();
|
|
1802
|
+
resetHistory();
|
|
1803
|
+
|
|
1804
|
+
assert.isNotNull(currentLayoutInfo);
|
|
1805
|
+
|
|
1806
|
+
if (currentLayoutInfo) {
|
|
1807
|
+
|
|
1808
|
+
const remoteMedia1 = currentLayoutInfo.activeSpeakerVideoPanes.mainBigOne.getRemoteMedia()[0];
|
|
1809
|
+
const remoteMedia2 = currentLayoutInfo.activeSpeakerVideoPanes.secondarySetOfSmallPanes.getRemoteMedia()[0];
|
|
1810
|
+
|
|
1811
|
+
const remoteMediaCsis = [{remoteMedia: remoteMedia1}, {remoteMedia: remoteMedia2}];
|
|
1812
|
+
|
|
1813
|
+
remoteMediaManager.setActiveSpeakerCsis([{remoteMedia: remoteMedia1}, {remoteMedia: remoteMedia2}]);
|
|
1814
|
+
|
|
1815
|
+
stubs.forEach((stub, index) => {
|
|
1816
|
+
assert.calledWith(stub, [remoteMediaCsis[index]], false)
|
|
1817
|
+
});
|
|
1818
|
+
assert.calledOnce(fakeMediaRequestManagers.video.commit);
|
|
1819
|
+
}
|
|
1820
|
+
});
|
|
1821
|
+
});
|
|
1822
|
+
|
|
1497
1823
|
describe('pinActiveSpeakerVideoPane() and isPinned()', () => {
|
|
1498
1824
|
it('throws if called on a pane not belonging to an active speaker group', async () => {
|
|
1499
1825
|
let currentLayoutInfo: VideoLayoutChangedEventData | null = null;
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import {assert} from '@webex/test-helper-chai';
|
|
2
2
|
import MockWebex from '@webex/test-helper-mock-webex';
|
|
3
3
|
import sinon from 'sinon';
|
|
4
|
-
import Reachability from '@webex/plugin-meetings/src/reachability/';
|
|
4
|
+
import Reachability, {ICECandidateResult} from '@webex/plugin-meetings/src/reachability/';
|
|
5
|
+
import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
|
|
6
|
+
|
|
7
|
+
import { IP_VERSION } from '@webex/plugin-meetings/src/constants';
|
|
5
8
|
|
|
6
9
|
describe('isAnyClusterReachable', () => {
|
|
7
10
|
let webex;
|
|
8
11
|
|
|
9
12
|
beforeEach(() => {
|
|
10
13
|
webex = new MockWebex();
|
|
14
|
+
|
|
15
|
+
sinon.stub(MeetingUtil, 'getIpVersion').returns(IP_VERSION.unknown);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
sinon.restore();
|
|
11
20
|
});
|
|
12
21
|
|
|
13
22
|
const checkIsClusterReachable = async (mockStorage: any, expectedValue: boolean) => {
|
|
@@ -66,19 +75,188 @@ describe('gatherReachability', () => {
|
|
|
66
75
|
it('stores the reachability', async () => {
|
|
67
76
|
const reachability = new Reachability(webex);
|
|
68
77
|
|
|
69
|
-
const
|
|
70
|
-
|
|
78
|
+
const reachabilityResults = {
|
|
79
|
+
clusters: {
|
|
80
|
+
clusterId: {
|
|
81
|
+
udp: 'testUDP',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
const getClustersResult = {
|
|
86
|
+
clusters: {clusterId: 'cluster'},
|
|
87
|
+
joinCookie: {id: 'id'},
|
|
88
|
+
};
|
|
71
89
|
|
|
72
|
-
reachability.reachabilityRequest.getClusters = sinon.stub().returns(
|
|
73
|
-
(reachability as any).performReachabilityCheck = sinon.stub().returns(reachabilityResults)
|
|
90
|
+
reachability.reachabilityRequest.getClusters = sinon.stub().returns(getClustersResult);
|
|
91
|
+
(reachability as any).performReachabilityCheck = sinon.stub().returns(reachabilityResults);
|
|
74
92
|
|
|
75
93
|
const result = await reachability.gatherReachability();
|
|
76
94
|
|
|
77
95
|
assert.equal(result, reachabilityResults);
|
|
78
96
|
|
|
79
|
-
const
|
|
97
|
+
const storedResultForReachabilityResult = await webex.boundedStorage.get(
|
|
98
|
+
'Reachability',
|
|
99
|
+
'reachability.result'
|
|
100
|
+
);
|
|
101
|
+
const storedResultForJoinCookie = await webex.boundedStorage.get(
|
|
102
|
+
'Reachability',
|
|
103
|
+
'reachability.joinCookie'
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
assert.equal(JSON.stringify(result), storedResultForReachabilityResult);
|
|
107
|
+
assert.equal(JSON.stringify(getClustersResult.joinCookie), storedResultForJoinCookie);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('does reachability only on udp', async () => {
|
|
111
|
+
const reachability = new Reachability(webex);
|
|
112
|
+
|
|
113
|
+
const getClustersResult = {
|
|
114
|
+
clusters: {clusterId: {
|
|
115
|
+
tcp: [
|
|
116
|
+
'stun:170.72.164.1:5004',
|
|
117
|
+
'stun:170.72.165.2:5004'
|
|
118
|
+
],
|
|
119
|
+
udp: [
|
|
120
|
+
'stun:170.72.164.3:5004',
|
|
121
|
+
'stun:170.72.164.3:9000',
|
|
122
|
+
],
|
|
123
|
+
xtls: [
|
|
124
|
+
'stun:external-media101.public.wjfkm-a-4.prod.infra.webex.com:443',
|
|
125
|
+
'stun:external-media94.public.wjfkm-a-8.prod.infra.webex.com:443'
|
|
126
|
+
]
|
|
127
|
+
}},
|
|
128
|
+
joinCookie: {id: 'id'},
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
sinon.stub(reachability.reachabilityRequest, 'getClusters').returns(getClustersResult);
|
|
132
|
+
|
|
133
|
+
const createPeerConnectionStub = sinon.stub(reachability, 'createPeerConnection');
|
|
80
134
|
|
|
81
|
-
|
|
135
|
+
await reachability.gatherReachability();
|
|
136
|
+
|
|
137
|
+
// check that a peer connection was created with only the udp urls
|
|
138
|
+
assert.calledOnceWithExactly(createPeerConnectionStub, {
|
|
139
|
+
key: 'clusterId',
|
|
140
|
+
config: {
|
|
141
|
+
iceServers: [
|
|
142
|
+
{
|
|
143
|
+
username: '',
|
|
144
|
+
credential: '',
|
|
145
|
+
urls: ['stun:170.72.164.3:5004'],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
username: '',
|
|
149
|
+
credential: '',
|
|
150
|
+
urls: ['stun:170.72.164.3:9000'],
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
iceCandidatePoolSize: '0',
|
|
154
|
+
iceTransportPolicy: 'all'
|
|
155
|
+
}
|
|
156
|
+
})
|
|
82
157
|
});
|
|
83
158
|
|
|
159
|
+
describe('clientMediaIPs', () => {
|
|
160
|
+
let testingClass: TestReachability;
|
|
161
|
+
|
|
162
|
+
class TestReachability extends Reachability {
|
|
163
|
+
public testParseIceResultsToReachabilityResults(iceResults: Array<ICECandidateResult>) {
|
|
164
|
+
return this.parseIceResultsToReachabilityResults(iceResults);
|
|
165
|
+
}
|
|
166
|
+
public testAddPublicIP(peerConnection: RTCPeerConnection, publicIP?: string | null) {
|
|
167
|
+
return this.addPublicIP(peerConnection, publicIP);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
beforeEach(() => {
|
|
171
|
+
testingClass = new TestReachability({webex});
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it('calls parseIceResultsToReachabilityResults correctly', () => {
|
|
175
|
+
const res = testingClass.testParseIceResultsToReachabilityResults([
|
|
176
|
+
{
|
|
177
|
+
clusterId: 'id1',
|
|
178
|
+
elapsed: '12312',
|
|
179
|
+
publicIPs: ['1.1.1.1'],
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
clusterId: 'id2',
|
|
183
|
+
elapsed: null,
|
|
184
|
+
publicIPs: ['1.1.1.1'],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
clusterId: 'id2',
|
|
188
|
+
elapsed: '14123',
|
|
189
|
+
publicIPs: undefined,
|
|
190
|
+
},
|
|
191
|
+
]);
|
|
192
|
+
|
|
193
|
+
assert.deepEqual(res, {
|
|
194
|
+
id1: {
|
|
195
|
+
tcp: {
|
|
196
|
+
untested: 'true',
|
|
197
|
+
},
|
|
198
|
+
xtls: {
|
|
199
|
+
untested: 'true',
|
|
200
|
+
},
|
|
201
|
+
udp: {
|
|
202
|
+
clientMediaIPs: ['1.1.1.1'],
|
|
203
|
+
latencyInMilliseconds: '12312',
|
|
204
|
+
reachable: 'true',
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
id2: {
|
|
208
|
+
xtls: {
|
|
209
|
+
untested: 'true',
|
|
210
|
+
},
|
|
211
|
+
tcp: {
|
|
212
|
+
untested: 'true',
|
|
213
|
+
},
|
|
214
|
+
udp: {
|
|
215
|
+
latencyInMilliseconds: '14123',
|
|
216
|
+
reachable: 'true',
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it('calls addPublicIP correctly with no existing public APIs', () => {
|
|
223
|
+
const peerConnection = {
|
|
224
|
+
connectionState: 'not_closed',
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
testingClass.testAddPublicIP(peerConnection as RTCPeerConnection, '1.1.1.1');
|
|
228
|
+
|
|
229
|
+
assert.deepEqual(peerConnection, {
|
|
230
|
+
connectionState: 'not_closed',
|
|
231
|
+
publicIPs: ['1.1.1.1'],
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it('calls addPublicIP correctly with existing public APIs', () => {
|
|
236
|
+
const peerConnection = {
|
|
237
|
+
connectionState: 'not_closed',
|
|
238
|
+
publicIPs: ['2.2.2.2'],
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
testingClass.testAddPublicIP(peerConnection as any, '1.1.1.1');
|
|
242
|
+
|
|
243
|
+
assert.deepEqual(peerConnection, {
|
|
244
|
+
connectionState: 'not_closed',
|
|
245
|
+
publicIPs: ['2.2.2.2', '1.1.1.1'],
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it('calls addPublicIP correctly null publicAPI', () => {
|
|
250
|
+
const peerConnection = {
|
|
251
|
+
connectionState: 'not_closed',
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
testingClass.testAddPublicIP(peerConnection as RTCPeerConnection, null);
|
|
255
|
+
|
|
256
|
+
assert.deepEqual(peerConnection, {
|
|
257
|
+
connectionState: 'not_closed',
|
|
258
|
+
publicIPs: null,
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
});
|
|
84
262
|
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
import {assert} from '@webex/test-helper-chai';
|
|
3
|
+
import MockWebex from '@webex/test-helper-mock-webex';
|
|
4
|
+
import Meetings from '@webex/plugin-meetings';
|
|
5
|
+
import ReachabilityRequest from '@webex/plugin-meetings/src/reachability/request';
|
|
6
|
+
import {IP_VERSION} from '@webex/plugin-meetings/src/constants';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
describe('plugin-meetings/reachability', () => {
|
|
10
|
+
let reachabilityRequest;
|
|
11
|
+
let webex;
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
webex = new MockWebex({
|
|
15
|
+
children: {
|
|
16
|
+
meetings: Meetings,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
webex.meetings.clientRegion = {
|
|
21
|
+
countryCode: 'US',
|
|
22
|
+
regionCode: 'WEST-COAST',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
webex.internal = {
|
|
26
|
+
services: {
|
|
27
|
+
get: sinon.mock().returns('locusUrl'),
|
|
28
|
+
waitForCatalog: sinon.mock().returns(Promise.resolve({})),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
reachabilityRequest = new ReachabilityRequest(webex);
|
|
34
|
+
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('#getClusters', () => {
|
|
38
|
+
it('sends a GET request with the correct params', async () => {
|
|
39
|
+
webex.request = sinon.mock().returns(Promise.resolve({
|
|
40
|
+
body: {
|
|
41
|
+
clusterClasses: {
|
|
42
|
+
hybridMedia: ["clusterId"]
|
|
43
|
+
},
|
|
44
|
+
clusters: {"clusterId": {
|
|
45
|
+
udp: "testUDP"
|
|
46
|
+
}},
|
|
47
|
+
joinCookie: {anycastEntryPoint: "aws-eu-west-1"}
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
|
|
51
|
+
const res = await reachabilityRequest.getClusters(IP_VERSION.only_ipv4);
|
|
52
|
+
|
|
53
|
+
const requestParams = webex.request.getCall(0).args[0];
|
|
54
|
+
|
|
55
|
+
assert.equal(requestParams.method, 'GET');
|
|
56
|
+
assert.equal(requestParams.resource, `clusters`);
|
|
57
|
+
assert.equal(requestParams.api, 'calliopeDiscovery');
|
|
58
|
+
assert.equal(requestParams.shouldRefreshAccessToken, false);
|
|
59
|
+
|
|
60
|
+
assert.deepEqual(requestParams.qs, {
|
|
61
|
+
JCSupport: 1,
|
|
62
|
+
ipver: 4,
|
|
63
|
+
});
|
|
64
|
+
assert.deepEqual(res.clusters.clusterId, {udp: "testUDP", isVideoMesh: true})
|
|
65
|
+
assert.deepEqual(res.joinCookie, {anycastEntryPoint: "aws-eu-west-1"})
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
});
|