@webex/plugin-meetings 3.0.0 → 3.1.0-next.10
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/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/common/errors/{reconnection-in-progress.js → reconnection-not-started.js} +27 -15
- package/dist/common/errors/reconnection-not-started.js.map +1 -0
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js +18 -6
- package/dist/constants.js.map +1 -1
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -1
- package/dist/interpretation/index.js +16 -2
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +7 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +10 -0
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +15 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/selfUtils.js +5 -0
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +163 -0
- package/dist/media/MediaConnectionAwaiter.js.map +1 -0
- package/dist/media/index.js +4 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +106 -81
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +6 -0
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1010 -753
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +37 -25
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +32 -23
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +10 -0
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/util.js +304 -267
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +334 -295
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/index.js +21 -23
- package/dist/meetings/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +1 -1
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +16 -2
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +179 -65
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +22 -0
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js +29 -15
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +18 -2
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +12 -10
- package/dist/reachability/request.js.map +1 -1
- package/dist/reachability/util.js +19 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reconnection-manager/index.js +140 -110
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/index.js +15 -0
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +3 -3
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +307 -126
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/index.js +57 -30
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +3 -0
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/types/common/errors/reconnection-not-started.d.ts +13 -0
- package/dist/{config.d.ts → types/config.d.ts} +1 -0
- package/dist/{constants.d.ts → types/constants.d.ts} +15 -6
- package/dist/types/index.d.ts +19 -0
- package/dist/types/media/MediaConnectionAwaiter.d.ts +61 -0
- package/dist/{media → types/media}/properties.d.ts +26 -2
- package/dist/{meeting → types/meeting}/in-meeting-actions.d.ts +6 -0
- package/dist/{meeting → types/meeting}/index.d.ts +29 -12
- package/dist/{meeting → types/meeting}/muteState.d.ts +2 -8
- package/dist/{meeting → types/meeting}/request.d.ts +3 -0
- package/dist/{meeting → types/meeting}/util.d.ts +3 -0
- package/dist/{meeting-info → types/meeting-info}/index.d.ts +1 -1
- package/dist/{meeting-info → types/meeting-info}/meeting-info-v2.d.ts +1 -1
- package/dist/types/meeting-info/util.d.ts +49 -0
- package/dist/types/meeting-info/utilv2.d.ts +65 -0
- package/dist/{meetings → types/meetings}/index.d.ts +9 -16
- package/dist/{multistream → types/multistream}/mediaRequestManager.d.ts +2 -1
- package/dist/{multistream → types/multistream}/remoteMediaGroup.d.ts +2 -0
- package/dist/{multistream → types/multistream}/remoteMediaManager.d.ts +15 -0
- package/dist/{multistream → types/multistream}/sendSlotManager.d.ts +9 -1
- package/dist/{reachability → types/reachability}/clusterReachability.d.ts +1 -0
- package/dist/{reachability → types/reachability}/index.d.ts +4 -0
- package/dist/{reachability → types/reachability}/util.d.ts +7 -0
- package/dist/{reconnection-manager → types/reconnection-manager}/index.d.ts +4 -14
- package/dist/{roap → types/roap}/index.d.ts +10 -2
- package/dist/{roap → types/roap}/turnDiscovery.d.ts +64 -17
- package/dist/webinar/index.js +1 -1
- package/package.json +23 -23
- package/src/common/errors/reconnection-not-started.ts +25 -0
- package/src/config.ts +1 -0
- package/src/constants.ts +18 -6
- package/src/index.ts +31 -0
- package/src/interpretation/index.ts +18 -1
- package/src/locus-info/controlsUtils.ts +11 -0
- package/src/locus-info/index.ts +16 -0
- package/src/locus-info/mediaSharesUtils.ts +16 -0
- package/src/locus-info/selfUtils.ts +5 -0
- package/src/media/MediaConnectionAwaiter.ts +174 -0
- package/src/media/index.ts +3 -1
- package/src/media/properties.ts +73 -46
- package/src/meeting/in-meeting-actions.ts +12 -0
- package/src/meeting/index.ts +389 -180
- package/src/meeting/muteState.ts +34 -20
- package/src/meeting/request.ts +18 -2
- package/src/meeting/util.ts +9 -0
- package/src/meeting-info/util.ts +241 -233
- package/src/meeting-info/utilv2.ts +250 -243
- package/src/meetings/index.ts +20 -24
- package/src/multistream/mediaRequestManager.ts +4 -1
- package/src/multistream/remoteMediaGroup.ts +19 -0
- package/src/multistream/remoteMediaManager.ts +101 -16
- package/src/multistream/sendSlotManager.ts +28 -0
- package/src/reachability/clusterReachability.ts +20 -5
- package/src/reachability/index.ts +24 -1
- package/src/reachability/request.ts +15 -11
- package/src/reachability/util.ts +21 -0
- package/src/reconnection-manager/index.ts +129 -106
- package/src/roap/index.ts +25 -3
- package/src/roap/request.ts +3 -3
- package/src/roap/turnDiscovery.ts +244 -78
- package/src/statsAnalyzer/index.ts +67 -27
- package/src/statsAnalyzer/mqaUtil.ts +5 -0
- package/test/integration/spec/journey.js +14 -14
- package/test/integration/spec/space-meeting.js +1 -1
- package/test/unit/spec/interpretation/index.ts +39 -3
- package/test/unit/spec/locus-info/controlsUtils.js +20 -0
- package/test/unit/spec/locus-info/index.js +49 -19
- package/test/unit/spec/locus-info/mediaSharesUtils.ts +9 -0
- package/test/unit/spec/locus-info/selfUtils.js +42 -12
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +344 -0
- package/test/unit/spec/media/index.ts +89 -78
- package/test/unit/spec/media/properties.ts +160 -209
- package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
- package/test/unit/spec/meeting/index.js +833 -205
- package/test/unit/spec/meeting/muteState.js +219 -67
- package/test/unit/spec/meeting/request.js +21 -0
- package/test/unit/spec/meeting/utils.js +9 -1
- package/test/unit/spec/meeting-info/utilv2.js +6 -0
- package/test/unit/spec/meetings/index.js +41 -26
- package/test/unit/spec/multistream/mediaRequestManager.ts +20 -2
- package/test/unit/spec/multistream/remoteMediaGroup.ts +79 -1
- package/test/unit/spec/multistream/remoteMediaManager.ts +199 -1
- package/test/unit/spec/multistream/sendSlotManager.ts +50 -18
- package/test/unit/spec/reachability/clusterReachability.ts +86 -22
- package/test/unit/spec/reachability/index.ts +197 -60
- package/test/unit/spec/reachability/request.js +15 -7
- package/test/unit/spec/reachability/util.ts +32 -2
- package/test/unit/spec/reconnection-manager/index.js +155 -39
- package/test/unit/spec/roap/index.ts +61 -6
- package/test/unit/spec/roap/turnDiscovery.ts +298 -16
- package/test/unit/spec/stats-analyzer/index.js +190 -0
- package/dist/common/errors/reconnection-in-progress.d.ts +0 -9
- package/dist/common/errors/reconnection-in-progress.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/meeting-info/util.d.ts +0 -2
- package/dist/meeting-info/utilv2.d.ts +0 -2
- package/dist/member/member.types.d.ts +0 -11
- package/dist/member/member.types.js +0 -17
- package/dist/member/member.types.js.map +0 -1
- package/src/common/errors/reconnection-in-progress.ts +0 -8
- package/src/member/member.types.ts +0 -13
- /package/dist/{annotation → types/annotation}/annotation.types.d.ts +0 -0
- /package/dist/{annotation → types/annotation}/constants.d.ts +0 -0
- /package/dist/{annotation → types/annotation}/index.d.ts +0 -0
- /package/dist/{breakouts → types/breakouts}/breakout.d.ts +0 -0
- /package/dist/{breakouts → types/breakouts}/collection.d.ts +0 -0
- /package/dist/{breakouts → types/breakouts}/edit-lock-error.d.ts +0 -0
- /package/dist/{breakouts → types/breakouts}/events.d.ts +0 -0
- /package/dist/{breakouts → types/breakouts}/index.d.ts +0 -0
- /package/dist/{breakouts → types/breakouts}/request.d.ts +0 -0
- /package/dist/{breakouts → types/breakouts}/utils.d.ts +0 -0
- /package/dist/{common → types/common}/browser-detection.d.ts +0 -0
- /package/dist/{common → types/common}/collection.d.ts +0 -0
- /package/dist/{common → types/common}/config.d.ts +0 -0
- /package/dist/{common → types/common}/errors/captcha-error.d.ts +0 -0
- /package/dist/{common → types/common}/errors/intent-to-join.d.ts +0 -0
- /package/dist/{common → types/common}/errors/join-meeting.d.ts +0 -0
- /package/dist/{common → types/common}/errors/media.d.ts +0 -0
- /package/dist/{common → types/common}/errors/no-meeting-info.d.ts +0 -0
- /package/dist/{common → types/common}/errors/parameter.d.ts +0 -0
- /package/dist/{common → types/common}/errors/password-error.d.ts +0 -0
- /package/dist/{common → types/common}/errors/permission.d.ts +0 -0
- /package/dist/{common → types/common}/errors/reclaim-host-role-errors.d.ts +0 -0
- /package/dist/{common → types/common}/errors/reconnection.d.ts +0 -0
- /package/dist/{common → types/common}/errors/stats.d.ts +0 -0
- /package/dist/{common → types/common}/errors/webex-errors.d.ts +0 -0
- /package/dist/{common → types/common}/errors/webex-meetings-error.d.ts +0 -0
- /package/dist/{common → types/common}/events/events-scope.d.ts +0 -0
- /package/dist/{common → types/common}/events/events.d.ts +0 -0
- /package/dist/{common → types/common}/events/trigger-proxy.d.ts +0 -0
- /package/dist/{common → types/common}/events/util.d.ts +0 -0
- /package/dist/{common → types/common}/logs/logger-config.d.ts +0 -0
- /package/dist/{common → types/common}/logs/logger-proxy.d.ts +0 -0
- /package/dist/{common → types/common}/logs/request.d.ts +0 -0
- /package/dist/{common → types/common}/queue.d.ts +0 -0
- /package/dist/{controls-options-manager → types/controls-options-manager}/constants.d.ts +0 -0
- /package/dist/{controls-options-manager → types/controls-options-manager}/enums.d.ts +0 -0
- /package/dist/{controls-options-manager → types/controls-options-manager}/index.d.ts +0 -0
- /package/dist/{controls-options-manager → types/controls-options-manager}/types.d.ts +0 -0
- /package/dist/{controls-options-manager → types/controls-options-manager}/util.d.ts +0 -0
- /package/dist/{interceptors → types/interceptors}/index.d.ts +0 -0
- /package/dist/{interceptors → types/interceptors}/locusRetry.d.ts +0 -0
- /package/dist/{interpretation → types/interpretation}/collection.d.ts +0 -0
- /package/dist/{interpretation → types/interpretation}/index.d.ts +0 -0
- /package/dist/{interpretation → types/interpretation}/siLanguage.d.ts +0 -0
- /package/dist/{locus-info → types/locus-info}/controlsUtils.d.ts +0 -0
- /package/dist/{locus-info → types/locus-info}/embeddedAppsUtils.d.ts +0 -0
- /package/dist/{locus-info → types/locus-info}/fullState.d.ts +0 -0
- /package/dist/{locus-info → types/locus-info}/hostUtils.d.ts +0 -0
- /package/dist/{locus-info → types/locus-info}/index.d.ts +0 -0
- /package/dist/{locus-info → types/locus-info}/infoUtils.d.ts +0 -0
- /package/dist/{locus-info → types/locus-info}/mediaSharesUtils.d.ts +0 -0
- /package/dist/{locus-info → types/locus-info}/parser.d.ts +0 -0
- /package/dist/{locus-info → types/locus-info}/selfUtils.d.ts +0 -0
- /package/dist/{media → types/media}/index.d.ts +0 -0
- /package/dist/{media → types/media}/util.d.ts +0 -0
- /package/dist/{mediaQualityMetrics → types/mediaQualityMetrics}/config.d.ts +0 -0
- /package/dist/{meeting → types/meeting}/locusMediaRequest.d.ts +0 -0
- /package/dist/{meeting → types/meeting}/request.type.d.ts +0 -0
- /package/dist/{meeting → types/meeting}/state.d.ts +0 -0
- /package/dist/{meeting → types/meeting}/voicea-meeting.d.ts +0 -0
- /package/dist/{meeting-info → types/meeting-info}/collection.d.ts +0 -0
- /package/dist/{meeting-info → types/meeting-info}/request.d.ts +0 -0
- /package/dist/{meetings → types/meetings}/collection.d.ts +0 -0
- /package/dist/{meetings → types/meetings}/meetings.types.d.ts +0 -0
- /package/dist/{meetings → types/meetings}/request.d.ts +0 -0
- /package/dist/{meetings → types/meetings}/util.d.ts +0 -0
- /package/dist/{member → types/member}/index.d.ts +0 -0
- /package/dist/{member → types/member}/types.d.ts +0 -0
- /package/dist/{member → types/member}/util.d.ts +0 -0
- /package/dist/{members → types/members}/collection.d.ts +0 -0
- /package/dist/{members → types/members}/index.d.ts +0 -0
- /package/dist/{members → types/members}/request.d.ts +0 -0
- /package/dist/{members → types/members}/types.d.ts +0 -0
- /package/dist/{members → types/members}/util.d.ts +0 -0
- /package/dist/{metrics → types/metrics}/constants.d.ts +0 -0
- /package/dist/{metrics → types/metrics}/index.d.ts +0 -0
- /package/dist/{multistream → types/multistream}/receiveSlot.d.ts +0 -0
- /package/dist/{multistream → types/multistream}/receiveSlotManager.d.ts +0 -0
- /package/dist/{multistream → types/multistream}/remoteMedia.d.ts +0 -0
- /package/dist/{networkQualityMonitor → types/networkQualityMonitor}/index.d.ts +0 -0
- /package/dist/{personal-meeting-room → types/personal-meeting-room}/index.d.ts +0 -0
- /package/dist/{personal-meeting-room → types/personal-meeting-room}/request.d.ts +0 -0
- /package/dist/{personal-meeting-room → types/personal-meeting-room}/util.d.ts +0 -0
- /package/dist/{reachability → types/reachability}/request.d.ts +0 -0
- /package/dist/{reactions → types/reactions}/constants.d.ts +0 -0
- /package/dist/{reactions → types/reactions}/reactions.d.ts +0 -0
- /package/dist/{reactions → types/reactions}/reactions.type.d.ts +0 -0
- /package/dist/{recording-controller → types/recording-controller}/enums.d.ts +0 -0
- /package/dist/{recording-controller → types/recording-controller}/index.d.ts +0 -0
- /package/dist/{recording-controller → types/recording-controller}/util.d.ts +0 -0
- /package/dist/{roap → types/roap}/request.d.ts +0 -0
- /package/dist/{rtcMetrics → types/rtcMetrics}/constants.d.ts +0 -0
- /package/dist/{rtcMetrics → types/rtcMetrics}/index.d.ts +0 -0
- /package/dist/{statsAnalyzer → types/statsAnalyzer}/global.d.ts +0 -0
- /package/dist/{statsAnalyzer → types/statsAnalyzer}/index.d.ts +0 -0
- /package/dist/{statsAnalyzer → types/statsAnalyzer}/mqaUtil.d.ts +0 -0
- /package/dist/{transcription → types/transcription}/index.d.ts +0 -0
- /package/dist/{webinar → types/webinar}/collection.d.ts +0 -0
- /package/dist/{webinar → types/webinar}/index.d.ts +0 -0
- /package/test/unit/spec/locus-info/{lib/selfConstant.js → selfConstant.js} +0 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {assert} from '@webex/test-helper-chai';
|
|
2
2
|
import sinon from 'sinon';
|
|
3
|
-
import {ConnectionState
|
|
3
|
+
import {ConnectionState} from '@webex/internal-media-core';
|
|
4
4
|
import MediaProperties from '@webex/plugin-meetings/src/media/properties';
|
|
5
|
-
import MediaUtil from '@webex/plugin-meetings/src/media/util';
|
|
6
5
|
import testUtils from '../../../utils/testUtils';
|
|
7
|
-
import {ICE_AND_DTLS_CONNECTION_TIMEOUT} from '@webex/plugin-meetings/src/constants';
|
|
8
6
|
import {Defer} from '@webex/common';
|
|
7
|
+
import MediaConnectionAwaiter from '../../../../src/media/MediaConnectionAwaiter';
|
|
9
8
|
|
|
10
9
|
describe('MediaProperties', () => {
|
|
11
10
|
let mediaProperties;
|
|
@@ -31,266 +30,218 @@ describe('MediaProperties', () => {
|
|
|
31
30
|
sinon.restore();
|
|
32
31
|
});
|
|
33
32
|
describe('waitForMediaConnectionConnected', () => {
|
|
34
|
-
it('resolves
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
it('rejects after timeout if ice state does not reach connected/completed', async () => {
|
|
38
|
-
mockMC.getConnectionState.returns(ConnectionState.Connecting);
|
|
39
|
-
|
|
40
|
-
let promiseResolved = false;
|
|
41
|
-
let promiseRejected = false;
|
|
42
|
-
|
|
43
|
-
mediaProperties
|
|
44
|
-
.waitForMediaConnectionConnected()
|
|
45
|
-
.then(() => {
|
|
46
|
-
promiseResolved = true;
|
|
47
|
-
})
|
|
48
|
-
.catch(() => {
|
|
49
|
-
promiseRejected = true;
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
assert.equal(promiseResolved, false);
|
|
53
|
-
assert.equal(promiseRejected, false);
|
|
54
|
-
|
|
55
|
-
await clock.tickAsync(ICE_AND_DTLS_CONNECTION_TIMEOUT);
|
|
56
|
-
await testUtils.flushPromises();
|
|
33
|
+
it('resolves if media connection is connected', async () => {
|
|
34
|
+
const waitForMediaConnectionConnectedResult = new Defer();
|
|
57
35
|
|
|
58
|
-
|
|
59
|
-
|
|
36
|
+
sinon
|
|
37
|
+
.stub(MediaConnectionAwaiter.prototype, 'waitForMediaConnectionConnected')
|
|
38
|
+
.returns(waitForMediaConnectionConnectedResult.promise);
|
|
60
39
|
|
|
61
|
-
|
|
62
|
-
assert.calledOnce(mockMC.on);
|
|
63
|
-
assert.equal(mockMC.on.getCall(0).args[0], Event.CONNECTION_STATE_CHANGED);
|
|
64
|
-
const listener = mockMC.on.getCall(0).args[1];
|
|
40
|
+
waitForMediaConnectionConnectedResult.resolve();
|
|
65
41
|
|
|
66
|
-
|
|
67
|
-
assert.calledWith(mockMC.off, Event.CONNECTION_STATE_CHANGED, listener);
|
|
42
|
+
await mediaProperties.waitForMediaConnectionConnected();
|
|
68
43
|
});
|
|
44
|
+
it('rejects if media connection is not connected', async () => {
|
|
45
|
+
const waitForMediaConnectionConnectedResult = new Defer();
|
|
69
46
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const clearTimeoutSpy = sinon.spy(clock, 'clearTimeout');
|
|
74
|
-
|
|
75
|
-
let promiseResolved = false;
|
|
76
|
-
let promiseRejected = false;
|
|
77
|
-
|
|
78
|
-
mediaProperties
|
|
79
|
-
.waitForMediaConnectionConnected()
|
|
80
|
-
.then(() => {
|
|
81
|
-
promiseResolved = true;
|
|
82
|
-
})
|
|
83
|
-
.catch(() => {
|
|
84
|
-
promiseRejected = true;
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
assert.equal(promiseResolved, false);
|
|
88
|
-
assert.equal(promiseRejected, false);
|
|
89
|
-
|
|
90
|
-
// check the right listener was registered
|
|
91
|
-
assert.calledOnce(mockMC.on);
|
|
92
|
-
assert.equal(mockMC.on.getCall(0).args[0], Event.CONNECTION_STATE_CHANGED);
|
|
93
|
-
const listener = mockMC.on.getCall(0).args[1];
|
|
94
|
-
|
|
95
|
-
// call the listener and pretend we are now connected
|
|
96
|
-
mockMC.getConnectionState.returns(ConnectionState.Connected);
|
|
97
|
-
listener();
|
|
98
|
-
await testUtils.flushPromises();
|
|
99
|
-
|
|
100
|
-
assert.equal(promiseResolved, true);
|
|
101
|
-
assert.equal(promiseRejected, false);
|
|
47
|
+
sinon
|
|
48
|
+
.stub(MediaConnectionAwaiter.prototype, 'waitForMediaConnectionConnected')
|
|
49
|
+
.returns(waitForMediaConnectionConnectedResult.promise);
|
|
102
50
|
|
|
103
|
-
|
|
104
|
-
assert.calledOnce(mockMC.off);
|
|
105
|
-
assert.calledWith(mockMC.off, Event.CONNECTION_STATE_CHANGED, listener);
|
|
51
|
+
waitForMediaConnectionConnectedResult.reject();
|
|
106
52
|
|
|
107
|
-
assert.
|
|
53
|
+
await assert.isRejected(mediaProperties.waitForMediaConnectionConnected());
|
|
108
54
|
});
|
|
109
55
|
});
|
|
110
56
|
|
|
111
|
-
describe('
|
|
112
|
-
it('
|
|
113
|
-
|
|
57
|
+
describe('getCurrentConnectionInfo', () => {
|
|
58
|
+
it('handles the case when getStats() fails', async () => {
|
|
59
|
+
mockMC.getStats.rejects(new Error());
|
|
114
60
|
|
|
115
|
-
|
|
61
|
+
const {connectionType, selectedCandidatePairChanges, numTransports} =
|
|
62
|
+
await mediaProperties.getCurrentConnectionInfo();
|
|
116
63
|
|
|
117
|
-
assert.
|
|
64
|
+
assert.equal(connectionType, 'unknown');
|
|
65
|
+
assert.equal(selectedCandidatePairChanges, -1);
|
|
66
|
+
assert.equal(numTransports, 0);
|
|
118
67
|
});
|
|
119
|
-
it('calls getStats() only after waitForMediaConnectionConnected resolves', async () => {
|
|
120
|
-
const waitForMediaConnectionConnectedResult = new Defer();
|
|
121
68
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
.
|
|
69
|
+
describe('selectedCandidatePairChanges and numTransports', () => {
|
|
70
|
+
it('returns correct values when getStats() returns no transport stats at all', async () => {
|
|
71
|
+
mockMC.getStats.resolves([{type: 'something', id: '1234'}]);
|
|
125
72
|
|
|
126
|
-
|
|
73
|
+
const {selectedCandidatePairChanges, numTransports} =
|
|
74
|
+
await mediaProperties.getCurrentConnectionInfo();
|
|
127
75
|
|
|
128
|
-
|
|
76
|
+
assert.equal(selectedCandidatePairChanges, -1);
|
|
77
|
+
assert.equal(numTransports, 0);
|
|
78
|
+
});
|
|
129
79
|
|
|
130
|
-
|
|
131
|
-
|
|
80
|
+
it('returns correct values when getStats() returns transport stats without selectedCandidatePairChanges', async () => {
|
|
81
|
+
mockMC.getStats.resolves([{type: 'transport', id: '1234'}]);
|
|
132
82
|
|
|
133
|
-
|
|
134
|
-
|
|
83
|
+
const {selectedCandidatePairChanges, numTransports} =
|
|
84
|
+
await mediaProperties.getCurrentConnectionInfo();
|
|
135
85
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
it('rejects if waitForMediaConnectionConnected rejects', async () => {
|
|
140
|
-
const waitForMediaConnectionConnectedResult = new Defer();
|
|
141
|
-
|
|
142
|
-
const waitForMediaConnectionConnectedStub = sinon
|
|
143
|
-
.stub(mediaProperties, 'waitForMediaConnectionConnected')
|
|
144
|
-
.returns(waitForMediaConnectionConnectedResult.promise);
|
|
86
|
+
assert.equal(selectedCandidatePairChanges, -1);
|
|
87
|
+
assert.equal(numTransports, 1);
|
|
88
|
+
});
|
|
145
89
|
|
|
146
|
-
|
|
90
|
+
it('returns correct values when getStats() returns transport stats with selectedCandidatePairChanges', async () => {
|
|
91
|
+
mockMC.getStats.resolves([
|
|
92
|
+
{type: 'transport', id: '1234', selectedCandidatePairChanges: 13},
|
|
93
|
+
]);
|
|
147
94
|
|
|
148
|
-
|
|
95
|
+
const {selectedCandidatePairChanges, numTransports} =
|
|
96
|
+
await mediaProperties.getCurrentConnectionInfo();
|
|
149
97
|
|
|
150
|
-
|
|
98
|
+
assert.equal(selectedCandidatePairChanges, 13);
|
|
99
|
+
assert.equal(numTransports, 1);
|
|
100
|
+
});
|
|
151
101
|
|
|
152
|
-
|
|
153
|
-
|
|
102
|
+
it('returns correct values when getStats() returns multiple transport stats', async () => {
|
|
103
|
+
mockMC.getStats.resolves([
|
|
104
|
+
{type: 'transport', id: '1', selectedCandidatePairChanges: 11},
|
|
105
|
+
{type: 'transport', id: '2', selectedCandidatePairChanges: 12},
|
|
106
|
+
]);
|
|
154
107
|
|
|
155
|
-
|
|
108
|
+
const {selectedCandidatePairChanges, numTransports} =
|
|
109
|
+
await mediaProperties.getCurrentConnectionInfo();
|
|
156
110
|
|
|
157
|
-
|
|
111
|
+
assert.equal(selectedCandidatePairChanges, 11); // we expect stats from the first transport to be returned
|
|
112
|
+
assert.equal(numTransports, 2);
|
|
113
|
+
});
|
|
158
114
|
});
|
|
159
|
-
|
|
160
|
-
|
|
115
|
+
describe('connectionType', () => {
|
|
116
|
+
it('returns "unknown" if getStats() returns no candidate pairs', async () => {
|
|
117
|
+
mockMC.getStats.resolves([{type: 'something', id: '1234'}]);
|
|
161
118
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
119
|
+
const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
|
|
120
|
+
assert.equal(connectionType, 'unknown');
|
|
121
|
+
});
|
|
165
122
|
|
|
166
|
-
|
|
167
|
-
|
|
123
|
+
it('returns "unknown" if getStats() returns no successful candidate pair', async () => {
|
|
124
|
+
mockMC.getStats.resolves([{type: 'candidate-pair', id: '1234', state: 'inprogress'}]);
|
|
168
125
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
126
|
+
const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
|
|
127
|
+
assert.equal(connectionType, 'unknown');
|
|
128
|
+
});
|
|
172
129
|
|
|
173
|
-
|
|
174
|
-
|
|
130
|
+
it('returns "unknown" if getStats() returns a successful candidate pair but local candidate is missing', async () => {
|
|
131
|
+
mockMC.getStats.resolves([
|
|
132
|
+
{type: 'candidate-pair', id: '1234', state: 'succeeded', localCandidateId: 'wrong id'},
|
|
133
|
+
]);
|
|
175
134
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
135
|
+
const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
|
|
136
|
+
assert.equal(connectionType, 'unknown');
|
|
137
|
+
});
|
|
179
138
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
139
|
+
it('returns "UDP" if getStats() returns a successful candidate pair with udp local candidate', async () => {
|
|
140
|
+
mockMC.getStats.resolves([
|
|
141
|
+
{
|
|
142
|
+
type: 'candidate-pair',
|
|
143
|
+
id: 'some candidate pair id',
|
|
144
|
+
state: 'succeeded',
|
|
145
|
+
localCandidateId: 'local candidate id',
|
|
146
|
+
},
|
|
147
|
+
{type: 'local-candidate', id: 'some other candidate id', protocol: 'tcp'},
|
|
148
|
+
{type: 'local-candidate', id: 'local candidate id', protocol: 'udp'},
|
|
149
|
+
]);
|
|
184
150
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
151
|
+
const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
|
|
152
|
+
assert.equal(connectionType, 'UDP');
|
|
153
|
+
});
|
|
188
154
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const connectionType = await mediaProperties.getCurrentConnectionType();
|
|
202
|
-
assert.equal(connectionType, 'UDP');
|
|
203
|
-
});
|
|
155
|
+
it('returns "TCP" if getStats() returns a successful candidate pair with tcp local candidate', async () => {
|
|
156
|
+
mockMC.getStats.resolves([
|
|
157
|
+
{
|
|
158
|
+
type: 'candidate-pair',
|
|
159
|
+
id: 'some candidate pair id',
|
|
160
|
+
state: 'succeeded',
|
|
161
|
+
localCandidateId: 'some candidate id',
|
|
162
|
+
},
|
|
163
|
+
{type: 'local-candidate', id: 'some other candidate id', protocol: 'udp'},
|
|
164
|
+
{type: 'local-candidate', id: 'some candidate id', protocol: 'tcp'},
|
|
165
|
+
]);
|
|
204
166
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
{
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
167
|
+
const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
|
|
168
|
+
assert.equal(connectionType, 'TCP');
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
[
|
|
172
|
+
{relayProtocol: 'tls', expectedConnectionType: 'TURN-TLS'},
|
|
173
|
+
{relayProtocol: 'tcp', expectedConnectionType: 'TURN-TCP'},
|
|
174
|
+
{relayProtocol: 'udp', expectedConnectionType: 'TURN-UDP'},
|
|
175
|
+
].forEach(({relayProtocol, expectedConnectionType}) =>
|
|
176
|
+
it(`returns "${expectedConnectionType}" if getStats() returns a successful candidate pair with a local candidate with relayProtocol=${relayProtocol}`, async () => {
|
|
177
|
+
mockMC.getStats.resolves([
|
|
178
|
+
{
|
|
179
|
+
type: 'candidate-pair',
|
|
180
|
+
id: 'some candidate pair id',
|
|
181
|
+
state: 'succeeded',
|
|
182
|
+
localCandidateId: 'selected candidate id',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'candidate-pair',
|
|
186
|
+
id: 'some other candidate pair id',
|
|
187
|
+
state: 'failed',
|
|
188
|
+
localCandidateId: 'some other candidate id 1',
|
|
189
|
+
},
|
|
190
|
+
{type: 'local-candidate', id: 'some other candidate id 1', protocol: 'udp'},
|
|
191
|
+
{type: 'local-candidate', id: 'some other candidate id 2', protocol: 'tcp'},
|
|
192
|
+
{
|
|
193
|
+
type: 'local-candidate',
|
|
194
|
+
id: 'selected candidate id',
|
|
195
|
+
protocol: 'udp',
|
|
196
|
+
relayProtocol,
|
|
197
|
+
},
|
|
198
|
+
]);
|
|
199
|
+
|
|
200
|
+
const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
|
|
201
|
+
assert.equal(connectionType, expectedConnectionType);
|
|
202
|
+
})
|
|
203
|
+
);
|
|
220
204
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
].forEach(({relayProtocol, expectedConnectionType}) =>
|
|
226
|
-
it(`returns "${expectedConnectionType}" if getStats() returns a successful candidate pair with a local candidate with relayProtocol=${relayProtocol}`, async () => {
|
|
205
|
+
it('returns connection type of the first successful candidate pair', async () => {
|
|
206
|
+
// in real life this will never happen and all active candidate pairs will have same transport,
|
|
207
|
+
// but here we're simulating a situation where they have different transports and just checking
|
|
208
|
+
// that the code still works and just returns the first one
|
|
227
209
|
mockMC.getStats.resolves([
|
|
210
|
+
{
|
|
211
|
+
type: 'inbound-rtp',
|
|
212
|
+
id: 'whatever',
|
|
213
|
+
},
|
|
228
214
|
{
|
|
229
215
|
type: 'candidate-pair',
|
|
230
216
|
id: 'some candidate pair id',
|
|
231
217
|
state: 'succeeded',
|
|
232
|
-
localCandidateId: 'selected candidate id',
|
|
218
|
+
localCandidateId: '1st selected candidate id',
|
|
233
219
|
},
|
|
234
220
|
{
|
|
235
221
|
type: 'candidate-pair',
|
|
236
222
|
id: 'some other candidate pair id',
|
|
237
|
-
state: '
|
|
238
|
-
localCandidateId: '
|
|
223
|
+
state: 'succeeded',
|
|
224
|
+
localCandidateId: '2nd selected candidate id',
|
|
239
225
|
},
|
|
240
226
|
{type: 'local-candidate', id: 'some other candidate id 1', protocol: 'udp'},
|
|
241
227
|
{type: 'local-candidate', id: 'some other candidate id 2', protocol: 'tcp'},
|
|
242
228
|
{
|
|
243
229
|
type: 'local-candidate',
|
|
244
|
-
id: 'selected candidate id',
|
|
230
|
+
id: '1st selected candidate id',
|
|
231
|
+
protocol: 'udp',
|
|
232
|
+
relayProtocol: 'tls',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
type: 'local-candidate',
|
|
236
|
+
id: '2nd selected candidate id',
|
|
245
237
|
protocol: 'udp',
|
|
246
|
-
relayProtocol,
|
|
238
|
+
relayProtocol: 'tcp',
|
|
247
239
|
},
|
|
248
240
|
]);
|
|
249
241
|
|
|
250
|
-
const connectionType = await mediaProperties.
|
|
251
|
-
assert.equal(connectionType,
|
|
252
|
-
})
|
|
253
|
-
);
|
|
254
|
-
|
|
255
|
-
it('returns connection type of the first successful candidate pair', async () => {
|
|
256
|
-
// in real life this will never happen and all active candidate pairs will have same transport,
|
|
257
|
-
// but here we're simulating a situation where they have different transports and just checking
|
|
258
|
-
// that the code still works and just returns the first one
|
|
259
|
-
mockMC.getStats.resolves([
|
|
260
|
-
{
|
|
261
|
-
type: 'inbound-rtp',
|
|
262
|
-
id: 'whatever',
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
type: 'candidate-pair',
|
|
266
|
-
id: 'some candidate pair id',
|
|
267
|
-
state: 'succeeded',
|
|
268
|
-
localCandidateId: '1st selected candidate id',
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
type: 'candidate-pair',
|
|
272
|
-
id: 'some other candidate pair id',
|
|
273
|
-
state: 'succeeded',
|
|
274
|
-
localCandidateId: '2nd selected candidate id',
|
|
275
|
-
},
|
|
276
|
-
{type: 'local-candidate', id: 'some other candidate id 1', protocol: 'udp'},
|
|
277
|
-
{type: 'local-candidate', id: 'some other candidate id 2', protocol: 'tcp'},
|
|
278
|
-
{
|
|
279
|
-
type: 'local-candidate',
|
|
280
|
-
id: '1st selected candidate id',
|
|
281
|
-
protocol: 'udp',
|
|
282
|
-
relayProtocol: 'tls',
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
type: 'local-candidate',
|
|
286
|
-
id: '2nd selected candidate id',
|
|
287
|
-
protocol: 'udp',
|
|
288
|
-
relayProtocol: 'tcp',
|
|
289
|
-
},
|
|
290
|
-
]);
|
|
291
|
-
|
|
292
|
-
const connectionType = await mediaProperties.getCurrentConnectionType();
|
|
293
|
-
assert.equal(connectionType, 'TURN-TLS');
|
|
242
|
+
const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
|
|
243
|
+
assert.equal(connectionType, 'TURN-TLS');
|
|
244
|
+
});
|
|
294
245
|
});
|
|
295
246
|
});
|
|
296
247
|
});
|
|
@@ -30,6 +30,9 @@ describe('plugin-meetings', () => {
|
|
|
30
30
|
canStartTranscribing: null,
|
|
31
31
|
canStopTranscribing: null,
|
|
32
32
|
isClosedCaptionActive: null,
|
|
33
|
+
canStartManualCaption: null,
|
|
34
|
+
canStopManualCaption: null,
|
|
35
|
+
isManualCaptionActive: null,
|
|
33
36
|
isSaveTranscriptsEnabled: null,
|
|
34
37
|
isWebexAssistantActive: null,
|
|
35
38
|
canViewCaptionPanel: null,
|
|
@@ -110,6 +113,9 @@ describe('plugin-meetings', () => {
|
|
|
110
113
|
'canEnableClosedCaption',
|
|
111
114
|
'canStopTranscribing',
|
|
112
115
|
'isClosedCaptionActive',
|
|
116
|
+
'canStartManualCaption',
|
|
117
|
+
'canStopManualCaption',
|
|
118
|
+
'isManualCaptionActive',
|
|
113
119
|
'isSaveTranscriptsEnabled',
|
|
114
120
|
'isWebexAssistantActive',
|
|
115
121
|
'canViewCaptionPanel',
|