@webex/plugin-meetings 3.0.0-test.1 → 3.1.0-next.1
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/.eslintrc.js +6 -0
- package/babel.config.js +3 -0
- package/dist/annotation/constants.js +12 -20
- package/dist/annotation/constants.js.map +1 -1
- package/dist/annotation/index.js +25 -10
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +2 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/collection.js +1 -2
- package/dist/breakouts/collection.js.map +1 -1
- package/dist/breakouts/edit-lock-error.js +1 -2
- package/dist/breakouts/edit-lock-error.js.map +1 -1
- package/dist/breakouts/events.js +1 -2
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +13 -14
- package/dist/breakouts/index.js.map +1 -1
- package/dist/breakouts/request.js +1 -2
- package/dist/breakouts/request.js.map +1 -1
- package/dist/breakouts/utils.js +3 -6
- package/dist/breakouts/utils.js.map +1 -1
- package/dist/common/browser-detection.js +2 -3
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js +3 -4
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js +1 -2
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +1 -2
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +1 -2
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +1 -2
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +1 -2
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/no-meeting-info.js +1 -2
- package/dist/common/errors/no-meeting-info.js.map +1 -1
- package/dist/common/errors/parameter.js +3 -4
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +1 -2
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +1 -2
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reclaim-host-role-errors.js +6 -10
- package/dist/common/errors/reclaim-host-role-errors.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js +1 -2
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +1 -2
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +1 -2
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +14 -15
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +1 -2
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js +1 -2
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js +1 -2
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js +1 -2
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js +1 -2
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js +1 -2
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js +1 -2
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +3 -4
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js +2 -4
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +4 -3
- package/dist/config.js.map +1 -1
- package/dist/constants.js +207 -380
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +3 -6
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/enums.js +7 -10
- package/dist/controls-options-manager/enums.js.map +1 -1
- package/dist/controls-options-manager/index.js +27 -32
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/util.js +1 -2
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/index.js +71 -4
- package/dist/index.js.map +1 -1
- package/dist/interceptors/index.js.map +1 -1
- package/dist/interceptors/locusRetry.js +4 -3
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interpretation/collection.js +1 -2
- package/dist/interpretation/collection.js.map +1 -1
- package/dist/interpretation/index.js +4 -5
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +2 -3
- package/dist/interpretation/siLanguage.js.map +1 -1
- package/dist/locus-info/controlsUtils.js +12 -13
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js +3 -4
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js +1 -2
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js +1 -2
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +23 -27
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +3 -4
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +16 -3
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +6 -10
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +12 -6
- 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 +9 -5
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +7 -28
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +1 -2
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js +9 -18
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +14 -2
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1411 -1036
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +4 -5
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +2 -4
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +45 -36
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js +1 -2
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +13 -10
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.js +169 -0
- package/dist/meeting/voicea-meeting.js.map +1 -0
- package/dist/meeting-info/collection.js +3 -4
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +5 -4
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +27 -29
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +1 -2
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js +306 -269
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +336 -294
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +5 -6
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +44 -17
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +2 -3
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +1 -4
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +1 -3
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js +6 -8
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +1 -2
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +1 -2
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +8 -7
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +2 -3
- package/dist/members/request.js.map +1 -1
- package/dist/members/types.js +3 -4
- package/dist/members/types.js.map +1 -1
- package/dist/members/util.js +3 -4
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +1 -2
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +3 -2
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +9 -11
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +3 -5
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +7 -9
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +3 -5
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +7 -6
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +32 -29
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +9 -6
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +1 -2
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +2 -3
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -3
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js +1 -2
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/clusterReachability.js +35 -20
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +41 -12
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +25 -20
- 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/reactions/constants.js +1 -2
- package/dist/reactions/constants.js.map +1 -1
- package/dist/reactions/reactions.js +2 -4
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js +6 -8
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +18 -11
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/enums.js +4 -5
- package/dist/recording-controller/enums.js.map +1 -1
- package/dist/recording-controller/index.js +43 -51
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/recording-controller/util.js +1 -2
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/roap/index.js +17 -3
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +10 -10
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +316 -134
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/rtcMetrics/constants.js +1 -2
- package/dist/rtcMetrics/constants.js.map +1 -1
- package/dist/rtcMetrics/index.js +4 -6
- package/dist/rtcMetrics/index.js.map +1 -1
- package/dist/statsAnalyzer/global.js +1 -2
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +123 -96
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +24 -31
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +1 -2
- package/dist/transcription/index.js.map +1 -1
- package/dist/types/common/logs/request.d.ts +1 -1
- package/dist/types/config.d.ts +1 -0
- package/dist/types/constants.d.ts +10 -5
- package/dist/types/index.d.ts +11 -0
- package/dist/types/media/MediaConnectionAwaiter.d.ts +61 -0
- package/dist/types/meeting/index.d.ts +71 -16
- package/dist/types/meeting/request.d.ts +3 -0
- package/dist/types/meeting/util.d.ts +1 -0
- package/dist/types/meeting/voicea-meeting.d.ts +16 -0
- package/dist/types/meeting-info/index.d.ts +1 -1
- package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -1
- package/dist/types/meeting-info/util.d.ts +49 -2
- package/dist/types/meeting-info/utilv2.d.ts +65 -2
- package/dist/types/meetings/index.d.ts +11 -2
- package/dist/types/members/util.d.ts +1 -1
- package/dist/types/multistream/mediaRequestManager.d.ts +1 -2
- package/dist/types/multistream/remoteMediaGroup.d.ts +1 -1
- package/dist/types/multistream/remoteMediaManager.d.ts +1 -2
- package/dist/types/multistream/sendSlotManager.d.ts +1 -2
- package/dist/types/reachability/clusterReachability.d.ts +1 -0
- package/dist/types/reachability/index.d.ts +4 -0
- package/dist/types/reachability/util.d.ts +7 -0
- package/dist/types/roap/index.d.ts +10 -2
- package/dist/types/roap/turnDiscovery.d.ts +64 -17
- package/dist/webinar/collection.js +1 -2
- package/dist/webinar/collection.js.map +1 -1
- package/dist/webinar/index.js +2 -3
- package/dist/webinar/index.js.map +1 -1
- package/jest.config.js +3 -0
- package/package.json +44 -25
- package/process +1 -0
- package/src/config.ts +3 -4
- package/src/constants.ts +13 -4
- package/src/index.ts +27 -0
- package/src/interpretation/index.ts +2 -2
- 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 +6 -31
- package/src/meeting/index.ts +526 -227
- package/src/meeting/request.ts +18 -2
- package/src/meeting/util.ts +6 -1
- package/src/meeting/voicea-meeting.ts +122 -0
- package/src/meeting-info/meeting-info-v2.ts +5 -11
- package/src/meeting-info/util.ts +244 -233
- package/src/meeting-info/utilv2.ts +262 -245
- package/src/meetings/index.ts +18 -0
- package/src/member/index.ts +0 -1
- package/src/multistream/mediaRequestManager.ts +1 -1
- package/src/multistream/remoteMediaGroup.ts +1 -1
- package/src/multistream/remoteMediaManager.ts +1 -2
- package/src/multistream/sendSlotManager.ts +1 -2
- 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 +1 -1
- package/src/roap/index.ts +25 -3
- package/src/roap/request.ts +2 -2
- package/src/roap/turnDiscovery.ts +244 -78
- package/src/statsAnalyzer/index.ts +63 -27
- package/test/integration/spec/journey.js +2 -2
- package/test/unit/spec/breakouts/breakout.ts +2 -1
- package/test/unit/spec/breakouts/index.ts +7 -4
- package/test/unit/spec/interpretation/index.ts +4 -1
- package/test/unit/spec/locus-info/index.js +27 -18
- package/test/unit/spec/locus-info/mediaSharesUtils.ts +9 -0
- package/test/unit/spec/locus-info/selfUtils.js +41 -11
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +344 -0
- package/test/unit/spec/media/index.ts +94 -78
- package/test/unit/spec/media/properties.ts +16 -70
- package/test/unit/spec/meeting/index.js +757 -141
- package/test/unit/spec/meeting/request.js +21 -0
- package/test/unit/spec/meeting/utils.js +58 -11
- package/test/unit/spec/meeting/voicea-meeting.ts +266 -0
- package/test/unit/spec/meeting-info/meetinginfov2.js +20 -15
- package/test/unit/spec/meeting-info/utilv2.js +6 -0
- package/test/unit/spec/meetings/index.js +101 -13
- package/test/unit/spec/metrics/index.js +1 -2
- package/test/unit/spec/multistream/mediaRequestManager.ts +1 -0
- package/test/unit/spec/multistream/remoteMediaGroup.ts +0 -1
- package/test/unit/spec/multistream/remoteMediaManager.ts +0 -1
- 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 +28 -0
- package/test/unit/spec/recording-controller/index.js +0 -1
- package/test/unit/spec/roap/index.ts +61 -6
- package/test/unit/spec/roap/turnDiscovery.ts +299 -17
- package/test/unit/spec/stats-analyzer/index.js +179 -0
|
@@ -381,7 +381,7 @@ describe('plugin-meetings', () => {
|
|
|
381
381
|
id: 'meeting-id'
|
|
382
382
|
})
|
|
383
383
|
};
|
|
384
|
-
|
|
384
|
+
const onBreakoutJoinResponseSpy = sinon.stub(breakoutEvent,'onBreakoutJoinResponse')
|
|
385
385
|
breakouts.currentBreakoutSession.sessionId = "sessionId-old";
|
|
386
386
|
breakouts.updateBreakout({
|
|
387
387
|
sessionId: 'sessionId-new',
|
|
@@ -398,7 +398,9 @@ describe('plugin-meetings', () => {
|
|
|
398
398
|
breakoutMoveId: 'breakoutMoveId',
|
|
399
399
|
});
|
|
400
400
|
|
|
401
|
-
assert.calledOnce(
|
|
401
|
+
assert.calledOnce(onBreakoutJoinResponseSpy);
|
|
402
|
+
|
|
403
|
+
onBreakoutJoinResponseSpy.restore()
|
|
402
404
|
|
|
403
405
|
});
|
|
404
406
|
|
|
@@ -408,7 +410,7 @@ describe('plugin-meetings', () => {
|
|
|
408
410
|
id: 'meeting-id'
|
|
409
411
|
})
|
|
410
412
|
};
|
|
411
|
-
|
|
413
|
+
const onBreakoutJoinResponseSpy = sinon.stub(breakoutEvent, 'onBreakoutJoinResponse');
|
|
412
414
|
breakouts.currentBreakoutSession.sessionId = "sessionId";
|
|
413
415
|
breakouts.currentBreakoutSession.groupId = "groupId";
|
|
414
416
|
breakouts.updateBreakout({
|
|
@@ -426,7 +428,8 @@ describe('plugin-meetings', () => {
|
|
|
426
428
|
breakoutMoveId: 'breakoutMoveId',
|
|
427
429
|
});
|
|
428
430
|
|
|
429
|
-
assert.notCalled(
|
|
431
|
+
assert.notCalled(onBreakoutJoinResponseSpy);
|
|
432
|
+
onBreakoutJoinResponseSpy.restore()
|
|
430
433
|
|
|
431
434
|
});
|
|
432
435
|
});
|
|
@@ -131,6 +131,7 @@ describe('plugin-meetings', () => {
|
|
|
131
131
|
assert.equal(interpretation.receiveLanguage, 'en');
|
|
132
132
|
assert.equal(interpretation.isActive, true);
|
|
133
133
|
assert.equal(interpretation.order, 0);
|
|
134
|
+
assert.equal(interpretation.selfIsInterpreter, true);
|
|
134
135
|
|
|
135
136
|
sampleData.interpretation = {
|
|
136
137
|
originalLanguage: 'en',
|
|
@@ -141,13 +142,15 @@ describe('plugin-meetings', () => {
|
|
|
141
142
|
assert.equal(interpretation.sourceLanguage, undefined);
|
|
142
143
|
assert.equal(interpretation.targetLanguage, 'zh');
|
|
143
144
|
assert.equal(interpretation.receiveLanguage, undefined);
|
|
145
|
+
assert.equal(interpretation.selfIsInterpreter, true);
|
|
144
146
|
|
|
145
147
|
sampleData.interpretation = {
|
|
146
148
|
order: 0,
|
|
147
149
|
};
|
|
148
|
-
assert.equal(interpretation.updateSelfInterpretation(sampleData),
|
|
150
|
+
assert.equal(interpretation.updateSelfInterpretation(sampleData), true);
|
|
149
151
|
assert.equal(interpretation.originalLanguage, undefined);
|
|
150
152
|
assert.equal(interpretation.targetLanguage, undefined);
|
|
153
|
+
assert.equal(interpretation.selfIsInterpreter, false);
|
|
151
154
|
});
|
|
152
155
|
});
|
|
153
156
|
|
|
@@ -1385,7 +1385,7 @@ describe('plugin-meetings', () => {
|
|
|
1385
1385
|
function: 'updateMeetingInfo',
|
|
1386
1386
|
},
|
|
1387
1387
|
LOCUSINFO.EVENTS.MEETING_INFO_UPDATED,
|
|
1388
|
-
payload
|
|
1388
|
+
payload,
|
|
1389
1389
|
];
|
|
1390
1390
|
|
|
1391
1391
|
if (expected) {
|
|
@@ -1404,7 +1404,7 @@ describe('plugin-meetings', () => {
|
|
|
1404
1404
|
function: 'updateMeetingInfo',
|
|
1405
1405
|
},
|
|
1406
1406
|
LOCUSINFO.EVENTS.MEETING_INFO_UPDATED,
|
|
1407
|
-
payload
|
|
1407
|
+
payload,
|
|
1408
1408
|
];
|
|
1409
1409
|
|
|
1410
1410
|
if (expected) {
|
|
@@ -1426,8 +1426,7 @@ describe('plugin-meetings', () => {
|
|
|
1426
1426
|
*/
|
|
1427
1427
|
sinon.stub(locusInfo, 'emitScoped').callsFake(() => {
|
|
1428
1428
|
assert.deepEqual(mockMeeting, expectedMeeting);
|
|
1429
|
-
})
|
|
1430
|
-
|
|
1429
|
+
});
|
|
1431
1430
|
|
|
1432
1431
|
// set the info initially as locusInfo.info starts as undefined
|
|
1433
1432
|
expectedMeeting = {
|
|
@@ -1907,7 +1906,7 @@ describe('plugin-meetings', () => {
|
|
|
1907
1906
|
locusInfo.locusParser.workingCopy = {
|
|
1908
1907
|
syncUrl: 'current sync url',
|
|
1909
1908
|
};
|
|
1910
|
-
|
|
1909
|
+
|
|
1911
1910
|
locusInfo.applyLocusDeltaData(LOCUS_URL_CHANGED, fakeLocus, meeting);
|
|
1912
1911
|
assert.calledOnceWithExactly(meeting.meetingRequest.getLocusDTO, {url: 'current sync url'});
|
|
1913
1912
|
});
|
|
@@ -1970,8 +1969,12 @@ describe('plugin-meetings', () => {
|
|
|
1970
1969
|
}).then(() => {
|
|
1971
1970
|
assert.calledTwice(meeting.meetingRequest.getLocusDTO);
|
|
1972
1971
|
|
|
1973
|
-
assert.deepEqual(meeting.meetingRequest.getLocusDTO.getCalls()[0].args, [
|
|
1974
|
-
|
|
1972
|
+
assert.deepEqual(meeting.meetingRequest.getLocusDTO.getCalls()[0].args, [
|
|
1973
|
+
{url: 'deltaSyncUrl'},
|
|
1974
|
+
]);
|
|
1975
|
+
assert.deepEqual(meeting.meetingRequest.getLocusDTO.getCalls()[1].args, [
|
|
1976
|
+
{url: 'fullSyncUrl'},
|
|
1977
|
+
]);
|
|
1975
1978
|
|
|
1976
1979
|
assert.calledWith(sendBehavioralMetricStub, 'js_sdk_locus_delta_sync_failed', {
|
|
1977
1980
|
correlationId: meeting.correlationId,
|
|
@@ -1999,8 +2002,12 @@ describe('plugin-meetings', () => {
|
|
|
1999
2002
|
}).then(() => {
|
|
2000
2003
|
assert.calledTwice(meeting.meetingRequest.getLocusDTO);
|
|
2001
2004
|
|
|
2002
|
-
assert.deepEqual(meeting.meetingRequest.getLocusDTO.getCalls()[0].args, [
|
|
2003
|
-
|
|
2005
|
+
assert.deepEqual(meeting.meetingRequest.getLocusDTO.getCalls()[0].args, [
|
|
2006
|
+
{url: 'deltaSyncUrl'},
|
|
2007
|
+
]);
|
|
2008
|
+
assert.deepEqual(meeting.meetingRequest.getLocusDTO.getCalls()[1].args, [
|
|
2009
|
+
{url: 'fullSyncUrl'},
|
|
2010
|
+
]);
|
|
2004
2011
|
|
|
2005
2012
|
assert.calledWith(sendBehavioralMetricStub, 'js_sdk_locus_delta_sync_failed', {
|
|
2006
2013
|
correlationId: meeting.correlationId,
|
|
@@ -2084,7 +2091,7 @@ describe('plugin-meetings', () => {
|
|
|
2084
2091
|
|
|
2085
2092
|
locusInfo.clearMainSessionLocusCache = sinon.stub();
|
|
2086
2093
|
locusInfo.getTheLocusToUpdate(newLocus);
|
|
2087
|
-
assert.notCalled(locusInfo.clearMainSessionLocusCache)
|
|
2094
|
+
assert.notCalled(locusInfo.clearMainSessionLocusCache);
|
|
2088
2095
|
});
|
|
2089
2096
|
|
|
2090
2097
|
it('return the new locus if return to main session but no cache and do not clear main session cache', () => {
|
|
@@ -2106,7 +2113,7 @@ describe('plugin-meetings', () => {
|
|
|
2106
2113
|
|
|
2107
2114
|
locusInfo.clearMainSessionLocusCache = sinon.stub();
|
|
2108
2115
|
locusInfo.getTheLocusToUpdate(newLocus);
|
|
2109
|
-
assert.notCalled(locusInfo.clearMainSessionLocusCache)
|
|
2116
|
+
assert.notCalled(locusInfo.clearMainSessionLocusCache);
|
|
2110
2117
|
});
|
|
2111
2118
|
|
|
2112
2119
|
it('return the new locus if not return to main session and clear main session cache', () => {
|
|
@@ -2116,9 +2123,9 @@ describe('plugin-meetings', () => {
|
|
|
2116
2123
|
sessionType: 'MAIN',
|
|
2117
2124
|
},
|
|
2118
2125
|
},
|
|
2119
|
-
self: {removed: true}
|
|
2126
|
+
self: {removed: true},
|
|
2120
2127
|
};
|
|
2121
|
-
locusInfo.fullState = {state: 'ACTIVE'}
|
|
2128
|
+
locusInfo.fullState = {state: 'ACTIVE'};
|
|
2122
2129
|
locusInfo.controls = {
|
|
2123
2130
|
breakout: {
|
|
2124
2131
|
sessionType: 'MAIN',
|
|
@@ -2134,7 +2141,7 @@ describe('plugin-meetings', () => {
|
|
|
2134
2141
|
|
|
2135
2142
|
locusInfo.clearMainSessionLocusCache = sinon.stub();
|
|
2136
2143
|
const result = locusInfo.getTheLocusToUpdate(newLocus);
|
|
2137
|
-
assert.calledOnce(locusInfo.clearMainSessionLocusCache)
|
|
2144
|
+
assert.calledOnce(locusInfo.clearMainSessionLocusCache);
|
|
2138
2145
|
|
|
2139
2146
|
assert.deepEqual(result, newLocus);
|
|
2140
2147
|
});
|
|
@@ -2146,9 +2153,9 @@ describe('plugin-meetings', () => {
|
|
|
2146
2153
|
sessionType: 'MAIN',
|
|
2147
2154
|
},
|
|
2148
2155
|
},
|
|
2149
|
-
self: {removed: undefined}
|
|
2156
|
+
self: {removed: undefined},
|
|
2150
2157
|
};
|
|
2151
|
-
locusInfo.fullState = {state: 'ACTIVE'}
|
|
2158
|
+
locusInfo.fullState = {state: 'ACTIVE'};
|
|
2152
2159
|
locusInfo.controls = {
|
|
2153
2160
|
breakout: {
|
|
2154
2161
|
sessionType: 'MAIN',
|
|
@@ -2164,7 +2171,7 @@ describe('plugin-meetings', () => {
|
|
|
2164
2171
|
|
|
2165
2172
|
locusInfo.clearMainSessionLocusCache = sinon.stub();
|
|
2166
2173
|
locusInfo.getTheLocusToUpdate(newLocus);
|
|
2167
|
-
assert.notCalled(locusInfo.clearMainSessionLocusCache)
|
|
2174
|
+
assert.notCalled(locusInfo.clearMainSessionLocusCache);
|
|
2168
2175
|
});
|
|
2169
2176
|
});
|
|
2170
2177
|
|
|
@@ -2611,7 +2618,9 @@ describe('plugin-meetings', () => {
|
|
|
2611
2618
|
// send an out-of-order delta
|
|
2612
2619
|
locusInfo.handleLocusDelta(oooDelta, mockMeeting);
|
|
2613
2620
|
|
|
2614
|
-
assert.calledOnceWithExactly(sendBehavioralMetricStub, 'js_sdk_locus_delta_ooo', {
|
|
2621
|
+
assert.calledOnceWithExactly(sendBehavioralMetricStub, 'js_sdk_locus_delta_ooo', {
|
|
2622
|
+
stack: sinon.match.any,
|
|
2623
|
+
});
|
|
2615
2624
|
|
|
2616
2625
|
await clock.tickAsync(12499);
|
|
2617
2626
|
await testUtils.flushPromises();
|
|
@@ -20,6 +20,15 @@ describe('getContentUrl', () => {
|
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
describe('getContentResourceType', () => {
|
|
24
|
+
it('getContentResourceType return correct resourceType value', () => {
|
|
25
|
+
const stub = Sinon.stub(MediaSharesUtils, 'extractContent').returns({resourceType:'resourceType'});
|
|
26
|
+
const resourceType = MediaSharesUtils.getContentResourceType();
|
|
27
|
+
assert.equal(resourceType,'resourceType');
|
|
28
|
+
stub.restore();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
23
32
|
describe('getContentBeneficiaryDeviceUrl', () => {
|
|
24
33
|
it('getContentBeneficiaryDeviceUrl return correct deviceUrl value', () => {
|
|
25
34
|
const mockContentBeneficiaryDeviceUrl = "https://wdm-a.wbx2.com/wdm/api/v1/devices/e9ffd8a1-1fae-42d1-afbe-013e951f93ab"
|
|
@@ -150,8 +150,7 @@ describe('plugin-meetings', () => {
|
|
|
150
150
|
|
|
151
151
|
it('should return false if no breakouts in current', () => {
|
|
152
152
|
const current = {
|
|
153
|
-
breakoutSessions: {
|
|
154
|
-
},
|
|
153
|
+
breakoutSessions: {},
|
|
155
154
|
};
|
|
156
155
|
const previous = {
|
|
157
156
|
breakoutSessions: {
|
|
@@ -293,7 +292,7 @@ describe('plugin-meetings', () => {
|
|
|
293
292
|
const clonedSelf = cloneDeep(self);
|
|
294
293
|
|
|
295
294
|
clonedSelf.controls.audio.requestedToUnmute = true;
|
|
296
|
-
clonedSelf.controls.audio.lastModifiedRequestedToUnmute = '2023-06-16T18:25:04.369Z'
|
|
295
|
+
clonedSelf.controls.audio.lastModifiedRequestedToUnmute = '2023-06-16T18:25:04.369Z';
|
|
297
296
|
|
|
298
297
|
const {updates} = SelfUtils.getSelves(self, clonedSelf);
|
|
299
298
|
|
|
@@ -345,6 +344,41 @@ describe('plugin-meetings', () => {
|
|
|
345
344
|
});
|
|
346
345
|
});
|
|
347
346
|
|
|
347
|
+
describe('mutedByOthersChanged', () => {
|
|
348
|
+
it('throws an error if changedSelf is not provided', function() {
|
|
349
|
+
assert.throws(() => SelfUtils.mutedByOthersChanged({}, null), 'New self must be defined to determine if self was muted by others.');
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it('return false when oldSelf is not defined', function() {
|
|
353
|
+
assert.equal(SelfUtils.mutedByOthersChanged(null, { remoteMuted: false }), false);
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
it('should return true when remoteMuted is true on entry', function() {
|
|
357
|
+
assert.equal(SelfUtils.mutedByOthersChanged(null, { remoteMuted: true }), true);
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
it('should return false when selfIdentity and modifiedBy are the same', function() {
|
|
361
|
+
assert.equal(SelfUtils.mutedByOthersChanged(
|
|
362
|
+
{ remoteMuted: false },
|
|
363
|
+
{ remoteMuted: true, selfIdentity: 'user1', modifiedBy: 'user1' }
|
|
364
|
+
), false);
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
it('should return true when remoteMuted values are different', function() {
|
|
368
|
+
assert.equal(SelfUtils.mutedByOthersChanged(
|
|
369
|
+
{ remoteMuted: false },
|
|
370
|
+
{ remoteMuted: true, selfIdentity: 'user1', modifiedBy: 'user2' }
|
|
371
|
+
), true);
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
it('should return true when remoteMuted is true and unmuteAllowed has changed', function() {
|
|
375
|
+
assert.equal(SelfUtils.mutedByOthersChanged(
|
|
376
|
+
{ remoteMuted: true, unmuteAllowed: false },
|
|
377
|
+
{ remoteMuted: true, unmuteAllowed: true, selfIdentity: 'user1', modifiedBy: 'user2' }
|
|
378
|
+
), true);
|
|
379
|
+
});
|
|
380
|
+
});
|
|
381
|
+
|
|
348
382
|
describe('videoMutedByOthersChanged', () => {
|
|
349
383
|
it('returns true if changed', () => {
|
|
350
384
|
assert.equal(
|
|
@@ -371,23 +405,18 @@ describe('plugin-meetings', () => {
|
|
|
371
405
|
const clonedSelf = cloneDeep(self);
|
|
372
406
|
|
|
373
407
|
it('get breakoutMoveId works', () => {
|
|
374
|
-
|
|
375
408
|
assert.deepEqual(SelfUtils.getReplacedBreakoutMoveId(self, deviceId), breakoutMoveId);
|
|
376
|
-
|
|
377
409
|
});
|
|
378
410
|
|
|
379
411
|
it('replaces is empty', () => {
|
|
380
|
-
|
|
381
412
|
clonedSelf.devices[0].replaces = undefined;
|
|
382
413
|
assert.deepEqual(SelfUtils.getReplacedBreakoutMoveId(clonedSelf, deviceId), null);
|
|
383
|
-
|
|
384
414
|
});
|
|
385
415
|
|
|
386
416
|
it('no self or self.devices is not array', () => {
|
|
387
|
-
|
|
388
417
|
assert.deepEqual(SelfUtils.getReplacedBreakoutMoveId(undefined, deviceId), null);
|
|
389
418
|
|
|
390
|
-
clonedSelf.devices =
|
|
419
|
+
clonedSelf.devices = {
|
|
391
420
|
url: 'https://wdm-a.wbx2.com/wdm/api/v1/devices/20eabde3-4254-48da-9a24',
|
|
392
421
|
deviceType: 'WEB',
|
|
393
422
|
mediaSessionsExternal: false,
|
|
@@ -395,10 +424,11 @@ describe('plugin-meetings', () => {
|
|
|
395
424
|
{
|
|
396
425
|
breakoutMoveId: 'e5caeb2c-ffcc-4e06-a08a-1122e7710398',
|
|
397
426
|
lastActive: '2023-05-04T07:14:32.068Z',
|
|
398
|
-
locusUrl:
|
|
427
|
+
locusUrl:
|
|
428
|
+
'https://locus-alpha-apdx.prod.meetapi.webex.com/locus/api/v1/loci/495061ca-7b3c-3b77-85ff-4e1bd58600d1',
|
|
399
429
|
replacedAt: '2023-05-04T07:16:04.905Z',
|
|
400
430
|
sessionId: 'be3147d4-c318-86d8-7611-8d24beaaca8d',
|
|
401
|
-
}
|
|
431
|
+
},
|
|
402
432
|
],
|
|
403
433
|
state: 'JOINED',
|
|
404
434
|
};
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import {assert} from '@webex/test-helper-chai';
|
|
2
|
+
import sinon from 'sinon';
|
|
3
|
+
import {ConnectionState, Event} from '@webex/internal-media-core';
|
|
4
|
+
import testUtils from '../../../utils/testUtils';
|
|
5
|
+
import {ICE_AND_DTLS_CONNECTION_TIMEOUT} from '@webex/plugin-meetings/src/constants';
|
|
6
|
+
import MediaConnectionAwaiter from '../../../../src/media/MediaConnectionAwaiter';
|
|
7
|
+
|
|
8
|
+
describe('MediaConnectionAwaiter', () => {
|
|
9
|
+
let mediaConnectionAwaiter;
|
|
10
|
+
let mockMC;
|
|
11
|
+
let clock;
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
clock = sinon.useFakeTimers();
|
|
15
|
+
|
|
16
|
+
mockMC = {
|
|
17
|
+
getStats: sinon.stub().resolves([]),
|
|
18
|
+
on: sinon.stub(),
|
|
19
|
+
off: sinon.stub(),
|
|
20
|
+
getConnectionState: sinon.stub().returns(ConnectionState.New),
|
|
21
|
+
getIceGatheringState: sinon.stub().returns('new'),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
mediaConnectionAwaiter = new MediaConnectionAwaiter({
|
|
25
|
+
webrtcMediaConnection: mockMC,
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
afterEach(() => {
|
|
30
|
+
clock.restore();
|
|
31
|
+
sinon.restore();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe('waitForMediaConnectionConnected', () => {
|
|
35
|
+
it('resolves immediately if connection state is connected', async () => {
|
|
36
|
+
mockMC.getConnectionState.returns(ConnectionState.Connected);
|
|
37
|
+
|
|
38
|
+
await mediaConnectionAwaiter.waitForMediaConnectionConnected();
|
|
39
|
+
|
|
40
|
+
assert.neverCalledWith(mockMC.on);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('rejects after timeout if ice state is not connected', async () => {
|
|
44
|
+
mockMC.getConnectionState.returns(ConnectionState.Connecting);
|
|
45
|
+
mockMC.getIceGatheringState.returns('gathering');
|
|
46
|
+
|
|
47
|
+
let promiseResolved = false;
|
|
48
|
+
let promiseRejected = false;
|
|
49
|
+
|
|
50
|
+
mediaConnectionAwaiter
|
|
51
|
+
.waitForMediaConnectionConnected()
|
|
52
|
+
.then(() => {
|
|
53
|
+
promiseResolved = true;
|
|
54
|
+
})
|
|
55
|
+
.catch(() => {
|
|
56
|
+
promiseRejected = true;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
await testUtils.flushPromises();
|
|
60
|
+
assert.equal(promiseResolved, false);
|
|
61
|
+
assert.equal(promiseRejected, false);
|
|
62
|
+
|
|
63
|
+
// check the right listener was registered
|
|
64
|
+
assert.calledTwice(mockMC.on);
|
|
65
|
+
assert.equal(mockMC.on.getCall(0).args[0], Event.CONNECTION_STATE_CHANGED);
|
|
66
|
+
assert.equal(mockMC.on.getCall(1).args[0], Event.ICE_GATHERING_STATE_CHANGED);
|
|
67
|
+
const listener = mockMC.on.getCall(1).args[1];
|
|
68
|
+
|
|
69
|
+
mockMC.getIceGatheringState.returns('complete');
|
|
70
|
+
listener();
|
|
71
|
+
|
|
72
|
+
await clock.tickAsync(ICE_AND_DTLS_CONNECTION_TIMEOUT);
|
|
73
|
+
await testUtils.flushPromises();
|
|
74
|
+
|
|
75
|
+
assert.equal(promiseResolved, false);
|
|
76
|
+
assert.equal(promiseRejected, true);
|
|
77
|
+
|
|
78
|
+
assert.calledTwice(mockMC.off);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('resolves after timeout if connection state reach connected/completed', async () => {
|
|
82
|
+
mockMC.getConnectionState.returns(ConnectionState.Connecting);
|
|
83
|
+
mockMC.getIceGatheringState.returns('gathering');
|
|
84
|
+
|
|
85
|
+
let promiseResolved = false;
|
|
86
|
+
let promiseRejected = false;
|
|
87
|
+
|
|
88
|
+
mediaConnectionAwaiter
|
|
89
|
+
.waitForMediaConnectionConnected()
|
|
90
|
+
.then(() => {
|
|
91
|
+
promiseResolved = true;
|
|
92
|
+
})
|
|
93
|
+
.catch(() => {
|
|
94
|
+
promiseRejected = true;
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
await testUtils.flushPromises();
|
|
98
|
+
assert.equal(promiseResolved, false);
|
|
99
|
+
assert.equal(promiseRejected, false);
|
|
100
|
+
|
|
101
|
+
// check the right listener was registered
|
|
102
|
+
assert.calledTwice(mockMC.on);
|
|
103
|
+
assert.equal(mockMC.on.getCall(0).args[0], Event.CONNECTION_STATE_CHANGED);
|
|
104
|
+
assert.equal(mockMC.on.getCall(1).args[0], Event.ICE_GATHERING_STATE_CHANGED);
|
|
105
|
+
|
|
106
|
+
mockMC.getConnectionState.returns(ConnectionState.Connected);
|
|
107
|
+
|
|
108
|
+
await clock.tickAsync(ICE_AND_DTLS_CONNECTION_TIMEOUT);
|
|
109
|
+
await testUtils.flushPromises();
|
|
110
|
+
|
|
111
|
+
assert.equal(promiseResolved, true);
|
|
112
|
+
assert.equal(promiseRejected, false);
|
|
113
|
+
|
|
114
|
+
assert.calledTwice(mockMC.off);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it(`resolves when media connection reaches "connected" state`, async () => {
|
|
118
|
+
mockMC.getConnectionState.returns(ConnectionState.Connecting);
|
|
119
|
+
mockMC.getIceGatheringState.returns('gathering');
|
|
120
|
+
|
|
121
|
+
const clearTimeoutSpy = sinon.spy(clock, 'clearTimeout');
|
|
122
|
+
|
|
123
|
+
let promiseResolved = false;
|
|
124
|
+
let promiseRejected = false;
|
|
125
|
+
|
|
126
|
+
mediaConnectionAwaiter
|
|
127
|
+
.waitForMediaConnectionConnected()
|
|
128
|
+
.then(() => {
|
|
129
|
+
promiseResolved = true;
|
|
130
|
+
})
|
|
131
|
+
.catch(() => {
|
|
132
|
+
promiseRejected = true;
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
await testUtils.flushPromises();
|
|
136
|
+
assert.equal(promiseResolved, false);
|
|
137
|
+
assert.equal(promiseRejected, false);
|
|
138
|
+
|
|
139
|
+
// check the right listener was registered
|
|
140
|
+
assert.calledTwice(mockMC.on);
|
|
141
|
+
assert.equal(mockMC.on.getCall(0).args[0], Event.CONNECTION_STATE_CHANGED);
|
|
142
|
+
assert.equal(mockMC.on.getCall(1).args[0], Event.ICE_GATHERING_STATE_CHANGED);
|
|
143
|
+
const listener = mockMC.on.getCall(0).args[1];
|
|
144
|
+
|
|
145
|
+
// call the listener and pretend we are now connected
|
|
146
|
+
mockMC.getConnectionState.returns(ConnectionState.Connected);
|
|
147
|
+
listener();
|
|
148
|
+
await testUtils.flushPromises();
|
|
149
|
+
|
|
150
|
+
assert.equal(promiseResolved, true);
|
|
151
|
+
assert.equal(promiseRejected, false);
|
|
152
|
+
|
|
153
|
+
// check that listener was removed
|
|
154
|
+
assert.calledTwice(mockMC.off);
|
|
155
|
+
|
|
156
|
+
assert.calledOnce(clearTimeoutSpy);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it(`ice gathering state update to "gathering" state does not update timer`, async () => {
|
|
160
|
+
mockMC.getConnectionState.returns(ConnectionState.Connecting);
|
|
161
|
+
mockMC.getIceGatheringState.returns('new');
|
|
162
|
+
|
|
163
|
+
const clearTimeoutSpy = sinon.spy(clock, 'clearTimeout');
|
|
164
|
+
|
|
165
|
+
let promiseResolved = false;
|
|
166
|
+
let promiseRejected = false;
|
|
167
|
+
|
|
168
|
+
mediaConnectionAwaiter
|
|
169
|
+
.waitForMediaConnectionConnected()
|
|
170
|
+
.then(() => {
|
|
171
|
+
promiseResolved = true;
|
|
172
|
+
})
|
|
173
|
+
.catch(() => {
|
|
174
|
+
promiseRejected = true;
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
await testUtils.flushPromises();
|
|
178
|
+
assert.equal(promiseResolved, false);
|
|
179
|
+
assert.equal(promiseRejected, false);
|
|
180
|
+
|
|
181
|
+
// check the right listener was registered
|
|
182
|
+
assert.calledTwice(mockMC.on);
|
|
183
|
+
assert.equal(mockMC.on.getCall(0).args[0], Event.CONNECTION_STATE_CHANGED);
|
|
184
|
+
assert.equal(mockMC.on.getCall(1).args[0], Event.ICE_GATHERING_STATE_CHANGED);
|
|
185
|
+
const listener = mockMC.on.getCall(1).args[1];
|
|
186
|
+
|
|
187
|
+
// call the listener and pretend we are now connected
|
|
188
|
+
mockMC.getIceGatheringState.returns('gathering');
|
|
189
|
+
listener();
|
|
190
|
+
|
|
191
|
+
mockMC.getConnectionState.returns(ConnectionState.Connected);
|
|
192
|
+
|
|
193
|
+
await clock.tickAsync(ICE_AND_DTLS_CONNECTION_TIMEOUT);
|
|
194
|
+
await testUtils.flushPromises();
|
|
195
|
+
|
|
196
|
+
assert.equal(promiseResolved, true);
|
|
197
|
+
assert.equal(promiseRejected, false);
|
|
198
|
+
|
|
199
|
+
// check that listener was removed
|
|
200
|
+
assert.calledTwice(mockMC.off);
|
|
201
|
+
|
|
202
|
+
assert.neverCalledWith(clearTimeoutSpy);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it(`ice gathering update to 'complete' state restarts the timer`, async () => {
|
|
206
|
+
mockMC.getConnectionState.returns(ConnectionState.Connecting);
|
|
207
|
+
mockMC.getIceGatheringState.returns('new');
|
|
208
|
+
|
|
209
|
+
const setTimeoutSpy = sinon.spy(clock, 'setTimeout');
|
|
210
|
+
const clearTimeoutSpy = sinon.spy(clock, 'clearTimeout');
|
|
211
|
+
|
|
212
|
+
let promiseResolved = false;
|
|
213
|
+
let promiseRejected = false;
|
|
214
|
+
|
|
215
|
+
mediaConnectionAwaiter
|
|
216
|
+
.waitForMediaConnectionConnected()
|
|
217
|
+
.then(() => {
|
|
218
|
+
promiseResolved = true;
|
|
219
|
+
})
|
|
220
|
+
.catch(() => {
|
|
221
|
+
promiseRejected = true;
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
await testUtils.flushPromises();
|
|
225
|
+
assert.equal(promiseResolved, false);
|
|
226
|
+
assert.equal(promiseRejected, false);
|
|
227
|
+
|
|
228
|
+
assert.calledOnce(setTimeoutSpy);
|
|
229
|
+
|
|
230
|
+
// check the right listener was registered
|
|
231
|
+
assert.calledTwice(mockMC.on);
|
|
232
|
+
assert.equal(mockMC.on.getCall(0).args[0], Event.CONNECTION_STATE_CHANGED);
|
|
233
|
+
assert.equal(mockMC.on.getCall(1).args[0], Event.ICE_GATHERING_STATE_CHANGED);
|
|
234
|
+
const listener = mockMC.on.getCall(1).args[1];
|
|
235
|
+
|
|
236
|
+
// call the listener and pretend we are now connected
|
|
237
|
+
mockMC.getIceGatheringState.returns('complete');
|
|
238
|
+
listener();
|
|
239
|
+
|
|
240
|
+
assert.calledOnce(clearTimeoutSpy);
|
|
241
|
+
assert.calledTwice(setTimeoutSpy);
|
|
242
|
+
|
|
243
|
+
mockMC.getConnectionState.returns(ConnectionState.Connected);
|
|
244
|
+
|
|
245
|
+
await clock.tickAsync(ICE_AND_DTLS_CONNECTION_TIMEOUT);
|
|
246
|
+
await testUtils.flushPromises();
|
|
247
|
+
|
|
248
|
+
assert.equal(promiseResolved, true);
|
|
249
|
+
assert.equal(promiseRejected, false);
|
|
250
|
+
|
|
251
|
+
// check that listener was removed
|
|
252
|
+
assert.calledTwice(mockMC.off);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it(`reject with restart timer once if gathering state is not complete`, async () => {
|
|
256
|
+
mockMC.getConnectionState.returns(ConnectionState.Connecting);
|
|
257
|
+
mockMC.getIceGatheringState.returns('new');
|
|
258
|
+
|
|
259
|
+
const setTimeoutSpy = sinon.spy(clock, 'setTimeout');
|
|
260
|
+
const clearTimeoutSpy = sinon.spy(clock, 'clearTimeout');
|
|
261
|
+
|
|
262
|
+
let promiseResolved = false;
|
|
263
|
+
let promiseRejected = false;
|
|
264
|
+
|
|
265
|
+
mediaConnectionAwaiter
|
|
266
|
+
.waitForMediaConnectionConnected()
|
|
267
|
+
.then(() => {
|
|
268
|
+
promiseResolved = true;
|
|
269
|
+
})
|
|
270
|
+
.catch(() => {
|
|
271
|
+
promiseRejected = true;
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
await testUtils.flushPromises();
|
|
275
|
+
assert.equal(promiseResolved, false);
|
|
276
|
+
assert.equal(promiseRejected, false);
|
|
277
|
+
|
|
278
|
+
// check the right listener was registered
|
|
279
|
+
assert.calledTwice(mockMC.on);
|
|
280
|
+
assert.equal(mockMC.on.getCall(0).args[0], Event.CONNECTION_STATE_CHANGED);
|
|
281
|
+
assert.equal(mockMC.on.getCall(1).args[0], Event.ICE_GATHERING_STATE_CHANGED);
|
|
282
|
+
|
|
283
|
+
await clock.tickAsync(ICE_AND_DTLS_CONNECTION_TIMEOUT * 2);
|
|
284
|
+
await testUtils.flushPromises();
|
|
285
|
+
|
|
286
|
+
assert.equal(promiseResolved, false);
|
|
287
|
+
assert.equal(promiseRejected, true);
|
|
288
|
+
|
|
289
|
+
// check that listener was removed
|
|
290
|
+
assert.calledTwice(mockMC.off);
|
|
291
|
+
|
|
292
|
+
assert.calledOnce(clearTimeoutSpy);
|
|
293
|
+
assert.calledTwice(setTimeoutSpy);
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
it(`resolves gathering and connection state complete right after`, async () => {
|
|
297
|
+
mockMC.getConnectionState.returns(ConnectionState.Connecting);
|
|
298
|
+
mockMC.getIceGatheringState.returns('new');
|
|
299
|
+
|
|
300
|
+
const setTimeoutSpy = sinon.spy(clock, 'setTimeout');
|
|
301
|
+
const clearTimeoutSpy = sinon.spy(clock, 'clearTimeout');
|
|
302
|
+
|
|
303
|
+
let promiseResolved = false;
|
|
304
|
+
let promiseRejected = false;
|
|
305
|
+
|
|
306
|
+
mediaConnectionAwaiter
|
|
307
|
+
.waitForMediaConnectionConnected()
|
|
308
|
+
.then(() => {
|
|
309
|
+
promiseResolved = true;
|
|
310
|
+
})
|
|
311
|
+
.catch(() => {
|
|
312
|
+
promiseRejected = true;
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
await testUtils.flushPromises();
|
|
316
|
+
assert.equal(promiseResolved, false);
|
|
317
|
+
assert.equal(promiseRejected, false);
|
|
318
|
+
|
|
319
|
+
// check the right listener was registered
|
|
320
|
+
assert.calledTwice(mockMC.on);
|
|
321
|
+
assert.equal(mockMC.on.getCall(0).args[0], Event.CONNECTION_STATE_CHANGED);
|
|
322
|
+
assert.equal(mockMC.on.getCall(1).args[0], Event.ICE_GATHERING_STATE_CHANGED);
|
|
323
|
+
const connectionStateListener = mockMC.on.getCall(0).args[1];
|
|
324
|
+
const iceGatheringListener = mockMC.on.getCall(1).args[1];
|
|
325
|
+
|
|
326
|
+
mockMC.getIceGatheringState.returns('complete');
|
|
327
|
+
iceGatheringListener();
|
|
328
|
+
|
|
329
|
+
mockMC.getConnectionState.returns(ConnectionState.Connected);
|
|
330
|
+
connectionStateListener();
|
|
331
|
+
|
|
332
|
+
await testUtils.flushPromises();
|
|
333
|
+
|
|
334
|
+
assert.equal(promiseResolved, true);
|
|
335
|
+
assert.equal(promiseRejected, false);
|
|
336
|
+
|
|
337
|
+
// check that listener was removed
|
|
338
|
+
assert.calledTwice(mockMC.off);
|
|
339
|
+
|
|
340
|
+
assert.calledTwice(clearTimeoutSpy);
|
|
341
|
+
assert.calledTwice(setTimeoutSpy);
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
});
|