@webex/calling 3.8.1-web-workers-keepalive.2 → 3.9.0-multipleLLM.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/dist/CallSettings/WxCallBackendConnector.js +2 -2
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +94 -27
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/types.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +82 -27
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +252 -98
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +26 -13
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +8 -6
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/constants.js +4 -4
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +3 -4
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +4 -3
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +279 -199
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +168 -85
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +146 -0
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -0
- package/dist/Metrics/index.js +68 -72
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +60 -0
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js.map +1 -1
- package/dist/common/Utils.js +18 -10
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +281 -132
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/types.js.map +1 -1
- package/dist/module/CallSettings/WxCallBackendConnector.js +1 -1
- package/dist/module/CallingClient/CallingClient.js +37 -8
- package/dist/module/CallingClient/calling/call.js +13 -0
- package/dist/module/CallingClient/constants.js +2 -2
- package/dist/module/CallingClient/line/index.js +3 -3
- package/dist/module/CallingClient/registration/register.js +40 -7
- package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +62 -0
- package/dist/module/Metrics/index.js +23 -31
- package/dist/module/common/Utils.js +13 -3
- package/dist/types/CallSettings/types.d.ts +1 -1
- package/dist/types/CallSettings/types.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +2 -2
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +1 -0
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +7 -0
- package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -0
- package/dist/types/Metrics/index.d.ts.map +1 -1
- package/dist/types/Metrics/types.d.ts +1 -1
- package/dist/types/Metrics/types.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +1 -0
- package/dist/types/common/types.d.ts.map +1 -1
- package/package.json +4 -5
|
@@ -10,11 +10,13 @@ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/defi
|
|
|
10
10
|
var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
|
|
11
11
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
12
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
13
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
16
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
13
17
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
14
18
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
|
|
15
19
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
16
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
17
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
18
20
|
var _asyncMutex = require("async-mutex");
|
|
19
21
|
var Media = _interopRequireWildcard(require("@webex/internal-media-core"));
|
|
20
22
|
var _types = require("../Logger/types");
|
|
@@ -32,6 +34,7 @@ var _callingClientFixtures = require("./callingClientFixtures");
|
|
|
32
34
|
var _line = _interopRequireDefault(require("./line"));
|
|
33
35
|
var _registerFixtures = require("./registration/registerFixtures");
|
|
34
36
|
var _constants2 = require("../common/constants");
|
|
37
|
+
var _windowsChromiumIceWarmupUtils = _interopRequireDefault(require("./windowsChromiumIceWarmupUtils"));
|
|
35
38
|
function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
36
39
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
37
40
|
function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -41,15 +44,6 @@ global.crypto = {
|
|
|
41
44
|
return '12345678-1234-5678-1234-567812345678';
|
|
42
45
|
}
|
|
43
46
|
};
|
|
44
|
-
jest.mock('../common/Utils', function () {
|
|
45
|
-
var originalModule = jest.requireActual('../common/Utils');
|
|
46
|
-
return _objectSpread(_objectSpread({}, originalModule), {}, {
|
|
47
|
-
uploadLogs: jest.fn().mockImplementation(function () {
|
|
48
|
-
return _promise.default.resolve(undefined);
|
|
49
|
-
}),
|
|
50
|
-
handleCallingClientErrors: jest.fn()
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
47
|
jest.spyOn(utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
54
48
|
describe('CallingClient Tests', function () {
|
|
55
49
|
// Common initializers
|
|
@@ -481,7 +475,7 @@ describe('CallingClient Tests', function () {
|
|
|
481
475
|
failurePayload = {
|
|
482
476
|
statusCode: 500
|
|
483
477
|
};
|
|
484
|
-
webex.request.
|
|
478
|
+
webex.request.mockRejectedValue(failurePayload);
|
|
485
479
|
_context16.next = 4;
|
|
486
480
|
return (0, _CallingClient.createClient)(webex, {
|
|
487
481
|
logger: {
|
|
@@ -518,15 +512,15 @@ describe('CallingClient Tests', function () {
|
|
|
518
512
|
}
|
|
519
513
|
}, _callee16);
|
|
520
514
|
})));
|
|
521
|
-
it('when
|
|
515
|
+
it('case when /myIP failed with 401', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
522
516
|
var failurePayload;
|
|
523
517
|
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
524
518
|
while (1) switch (_context17.prev = _context17.next) {
|
|
525
519
|
case 0:
|
|
526
520
|
failurePayload = {
|
|
527
|
-
statusCode:
|
|
521
|
+
statusCode: 401
|
|
528
522
|
};
|
|
529
|
-
webex.request.
|
|
523
|
+
webex.request.mockRejectedValueOnce(failurePayload);
|
|
530
524
|
_context17.next = 4;
|
|
531
525
|
return (0, _CallingClient.createClient)(webex, {
|
|
532
526
|
logger: {
|
|
@@ -535,6 +529,39 @@ describe('CallingClient Tests', function () {
|
|
|
535
529
|
});
|
|
536
530
|
case 4:
|
|
537
531
|
callingClient = _context17.sent;
|
|
532
|
+
expect(webex.request).toBeCalledOnceWith(_objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
533
|
+
uri: 'https://mobius-us-east-1.prod.infra.webex.com/api/v1/calling/web/myip',
|
|
534
|
+
method: 'GET'
|
|
535
|
+
}));
|
|
536
|
+
expect(handleErrorSpy).toBeCalledOnceWith(failurePayload, expect.anything(), {
|
|
537
|
+
file: _constants.CALLING_CLIENT_FILE,
|
|
538
|
+
method: 'getMobiusServers'
|
|
539
|
+
});
|
|
540
|
+
expect(callingClient.primaryMobiusUris).toEqual(["".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT)]);
|
|
541
|
+
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", '');
|
|
542
|
+
case 9:
|
|
543
|
+
case "end":
|
|
544
|
+
return _context17.stop();
|
|
545
|
+
}
|
|
546
|
+
}, _callee17);
|
|
547
|
+
})));
|
|
548
|
+
it('when region discovery succeeds but region based mobius url discovery fails', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
549
|
+
var failurePayload;
|
|
550
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
551
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
552
|
+
case 0:
|
|
553
|
+
failurePayload = {
|
|
554
|
+
statusCode: 500
|
|
555
|
+
};
|
|
556
|
+
webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockRejectedValueOnce(failurePayload);
|
|
557
|
+
_context18.next = 4;
|
|
558
|
+
return (0, _CallingClient.createClient)(webex, {
|
|
559
|
+
logger: {
|
|
560
|
+
level: _types.LOGGER.INFO
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
case 4:
|
|
564
|
+
callingClient = _context18.sent;
|
|
538
565
|
expect(handleErrorSpy).toBeCalledWith(failurePayload, expect.anything(), {
|
|
539
566
|
file: _constants.CALLING_CLIENT_FILE,
|
|
540
567
|
method: 'getMobiusServers'
|
|
@@ -555,19 +582,59 @@ describe('CallingClient Tests', function () {
|
|
|
555
582
|
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", '');
|
|
556
583
|
case 11:
|
|
557
584
|
case "end":
|
|
558
|
-
return
|
|
585
|
+
return _context18.stop();
|
|
559
586
|
}
|
|
560
|
-
},
|
|
587
|
+
}, _callee18);
|
|
588
|
+
})));
|
|
589
|
+
it('case when discovery failed with 401', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
590
|
+
var failurePayload;
|
|
591
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
592
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
593
|
+
case 0:
|
|
594
|
+
failurePayload = {
|
|
595
|
+
statusCode: 401
|
|
596
|
+
};
|
|
597
|
+
webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockRejectedValueOnce(failurePayload);
|
|
598
|
+
_context19.next = 4;
|
|
599
|
+
return (0, _CallingClient.createClient)(webex, {
|
|
600
|
+
logger: {
|
|
601
|
+
level: _types.LOGGER.INFO
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
case 4:
|
|
605
|
+
callingClient = _context19.sent;
|
|
606
|
+
expect(webex.request).toBeCalledTimes(2);
|
|
607
|
+
expect(webex.request).nthCalledWith(1, _objectSpread(_objectSpread({}, (0, _testUtil.getMockRequestTemplate)()), {}, {
|
|
608
|
+
uri: 'https://mobius-us-east-1.prod.infra.webex.com/api/v1/calling/web/myip',
|
|
609
|
+
method: 'GET'
|
|
610
|
+
}));
|
|
611
|
+
expect(webex.request).nthCalledWith(2, {
|
|
612
|
+
method: 'GET',
|
|
613
|
+
uri: "".concat(_constants.DISCOVERY_URL, "/").concat(_callingClientFixtures.myIP),
|
|
614
|
+
addAuthHeader: false,
|
|
615
|
+
headers: (0, _defineProperty2.default)({}, _constants.SPARK_USER_AGENT, null)
|
|
616
|
+
});
|
|
617
|
+
expect(handleErrorSpy).toBeCalledOnceWith(failurePayload, expect.anything(), {
|
|
618
|
+
file: _constants.CALLING_CLIENT_FILE,
|
|
619
|
+
method: 'getMobiusServers'
|
|
620
|
+
});
|
|
621
|
+
expect(callingClient.primaryMobiusUris).toEqual(["".concat(callingClient['mobiusHost']).concat(_constants.URL_ENDPOINT)]);
|
|
622
|
+
expect(warnSpy).toBeCalledWith("Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers", '');
|
|
623
|
+
case 11:
|
|
624
|
+
case "end":
|
|
625
|
+
return _context19.stop();
|
|
626
|
+
}
|
|
627
|
+
}, _callee19);
|
|
561
628
|
})));
|
|
562
|
-
it('Verify successful mobius server url discovery after initializing callingClient through a config', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
629
|
+
it('Verify successful mobius server url discovery after initializing callingClient through a config', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
563
630
|
var infoSpy;
|
|
564
|
-
return _regenerator.default.wrap(function
|
|
565
|
-
while (1) switch (
|
|
631
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
632
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
566
633
|
case 0:
|
|
567
634
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
568
635
|
infoSpy.mockReset();
|
|
569
636
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.discoveryPayload);
|
|
570
|
-
|
|
637
|
+
_context20.next = 5;
|
|
571
638
|
return (0, _CallingClient.createClient)(webex, {
|
|
572
639
|
discovery: {
|
|
573
640
|
region: 'AP-SOUTHEAST',
|
|
@@ -578,7 +645,7 @@ describe('CallingClient Tests', function () {
|
|
|
578
645
|
}
|
|
579
646
|
});
|
|
580
647
|
case 5:
|
|
581
|
-
callingClient =
|
|
648
|
+
callingClient = _context20.sent;
|
|
582
649
|
expect(callingClient.primaryMobiusUris).toEqual([_callingClientFixtures.primaryUrl]);
|
|
583
650
|
expect(infoSpy).toHaveBeenCalledWith(_constants2.METHOD_START_MESSAGE, {
|
|
584
651
|
file: 'CallingClient',
|
|
@@ -591,66 +658,66 @@ describe('CallingClient Tests', function () {
|
|
|
591
658
|
expect(handleErrorSpy).not.toHaveBeenCalled();
|
|
592
659
|
case 10:
|
|
593
660
|
case "end":
|
|
594
|
-
return
|
|
661
|
+
return _context20.stop();
|
|
595
662
|
}
|
|
596
|
-
},
|
|
663
|
+
}, _callee20);
|
|
597
664
|
})));
|
|
598
665
|
});
|
|
599
666
|
describe('Testing each cluster present withing host catalog', function () {
|
|
600
667
|
var mobiusCluster = ['mobius-eu-central-1.prod.infra.webex.com', 'mobius-us-east-1.int.infra.webex.com', 'mobius-eu-central-1.int.infra.webex.com'];
|
|
601
668
|
var checkCluster = /*#__PURE__*/function () {
|
|
602
|
-
var
|
|
669
|
+
var _ref21 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(mockServiceHosts, mockCatalog) {
|
|
603
670
|
var callingClient;
|
|
604
|
-
return _regenerator.default.wrap(function
|
|
605
|
-
while (1) switch (
|
|
671
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
672
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
606
673
|
case 0:
|
|
607
674
|
webex.internal.services._hostCatalog = mockCatalog;
|
|
608
|
-
|
|
675
|
+
_context21.next = 3;
|
|
609
676
|
return (0, _CallingClient.createClient)(webex, {
|
|
610
677
|
logger: {
|
|
611
678
|
level: _types.LOGGER.INFO
|
|
612
679
|
}
|
|
613
680
|
});
|
|
614
681
|
case 3:
|
|
615
|
-
callingClient =
|
|
682
|
+
callingClient = _context21.sent;
|
|
616
683
|
expect(callingClient['mobiusClusters']).toStrictEqual(mockServiceHosts);
|
|
617
684
|
case 5:
|
|
618
685
|
case "end":
|
|
619
|
-
return
|
|
686
|
+
return _context21.stop();
|
|
620
687
|
}
|
|
621
|
-
},
|
|
688
|
+
}, _callee21);
|
|
622
689
|
}));
|
|
623
690
|
return function checkCluster(_x, _x2) {
|
|
624
|
-
return
|
|
691
|
+
return _ref21.apply(this, arguments);
|
|
625
692
|
};
|
|
626
693
|
}();
|
|
627
694
|
it.each(mobiusCluster)('%s', /*#__PURE__*/function () {
|
|
628
|
-
var
|
|
629
|
-
return _regenerator.default.wrap(function
|
|
630
|
-
while (1) switch (
|
|
695
|
+
var _ref22 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(clusterName) {
|
|
696
|
+
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
697
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
631
698
|
case 0:
|
|
632
|
-
|
|
633
|
-
|
|
699
|
+
_context22.t0 = clusterName;
|
|
700
|
+
_context22.next = _context22.t0 === 'mobius-eu-central-1.prod.infra.webex.com' ? 3 : _context22.t0 === 'mobius-us-east-1.int.infra.webex.com' ? 5 : _context22.t0 === 'mobius-eu-central-1.int.infra.webex.com' ? 7 : 9;
|
|
634
701
|
break;
|
|
635
702
|
case 3:
|
|
636
703
|
checkCluster(_callingClientFixtures.mockEUServiceHosts, _callingClientFixtures.mockCatalogEU);
|
|
637
|
-
return
|
|
704
|
+
return _context22.abrupt("break", 10);
|
|
638
705
|
case 5:
|
|
639
706
|
checkCluster(_callingClientFixtures.mockIntServiceHosts, _callingClientFixtures.mockCatalogUSInt);
|
|
640
|
-
return
|
|
707
|
+
return _context22.abrupt("break", 10);
|
|
641
708
|
case 7:
|
|
642
709
|
checkCluster(_callingClientFixtures.mockEUIntServiceHosts, _callingClientFixtures.mockCatalogEUInt);
|
|
643
|
-
return
|
|
710
|
+
return _context22.abrupt("break", 10);
|
|
644
711
|
case 9:
|
|
645
|
-
return
|
|
712
|
+
return _context22.abrupt("break", 10);
|
|
646
713
|
case 10:
|
|
647
714
|
case "end":
|
|
648
|
-
return
|
|
715
|
+
return _context22.stop();
|
|
649
716
|
}
|
|
650
|
-
},
|
|
717
|
+
}, _callee22);
|
|
651
718
|
}));
|
|
652
719
|
return function (_x3) {
|
|
653
|
-
return
|
|
720
|
+
return _ref22.apply(this, arguments);
|
|
654
721
|
};
|
|
655
722
|
}());
|
|
656
723
|
});
|
|
@@ -663,23 +730,23 @@ describe('CallingClient Tests', function () {
|
|
|
663
730
|
var deRegSpy;
|
|
664
731
|
var restartRegisterSpy;
|
|
665
732
|
var registerSpy;
|
|
666
|
-
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
667
|
-
return _regenerator.default.wrap(function
|
|
668
|
-
while (1) switch (
|
|
733
|
+
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
734
|
+
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
735
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
669
736
|
case 0:
|
|
670
737
|
jest.useFakeTimers();
|
|
671
738
|
webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockResolvedValueOnce(_callingClientFixtures.discoveryPayload).mockResolvedValueOnce(_callingClientFixtures.registrationPayload);
|
|
672
|
-
|
|
739
|
+
_context23.next = 4;
|
|
673
740
|
return (0, _CallingClient.createClient)(webex, {
|
|
674
741
|
logger: {
|
|
675
742
|
level: _types.LOGGER.INFO
|
|
676
743
|
}
|
|
677
744
|
});
|
|
678
745
|
case 4:
|
|
679
|
-
callingClient =
|
|
746
|
+
callingClient = _context23.sent;
|
|
680
747
|
line = (0, _values.default)(callingClient.lineDict)[0];
|
|
681
748
|
reg = line.registration;
|
|
682
|
-
|
|
749
|
+
_context23.next = 9;
|
|
683
750
|
return line.register();
|
|
684
751
|
case 9:
|
|
685
752
|
deRegSpy = jest.spyOn(line.registration, 'deregister');
|
|
@@ -688,9 +755,9 @@ describe('CallingClient Tests', function () {
|
|
|
688
755
|
registerSpy = jest.spyOn(reg, 'attemptRegistrationWithServers');
|
|
689
756
|
case 13:
|
|
690
757
|
case "end":
|
|
691
|
-
return
|
|
758
|
+
return _context23.stop();
|
|
692
759
|
}
|
|
693
|
-
},
|
|
760
|
+
}, _callee23);
|
|
694
761
|
})));
|
|
695
762
|
afterEach(function () {
|
|
696
763
|
jest.clearAllTimers();
|
|
@@ -700,9 +767,9 @@ describe('CallingClient Tests', function () {
|
|
|
700
767
|
callingClient = undefined;
|
|
701
768
|
jest.useRealTimers();
|
|
702
769
|
});
|
|
703
|
-
it('detect a network flap in mercury connection', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
704
|
-
return _regenerator.default.wrap(function
|
|
705
|
-
while (1) switch (
|
|
770
|
+
it('detect a network flap in mercury connection', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
771
|
+
return _regenerator.default.wrap(function _callee24$(_context24) {
|
|
772
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
706
773
|
case 0:
|
|
707
774
|
warnSpy.mockClear();
|
|
708
775
|
expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
|
|
@@ -721,7 +788,7 @@ describe('CallingClient Tests', function () {
|
|
|
721
788
|
webex.internal.mercury.connected = true;
|
|
722
789
|
logSpy.mockReset();
|
|
723
790
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
724
|
-
|
|
791
|
+
_context24.next = 10;
|
|
725
792
|
return flushPromises();
|
|
726
793
|
case 10:
|
|
727
794
|
_Logger.default.info('Mercury connection is up again, re-registering with Webex Calling if needed', {
|
|
@@ -741,14 +808,14 @@ describe('CallingClient Tests', function () {
|
|
|
741
808
|
expect(registerSpy).toHaveBeenCalledWith('handleConnectionRestoration', [_callingClientFixtures.primaryUrl]);
|
|
742
809
|
case 17:
|
|
743
810
|
case "end":
|
|
744
|
-
return
|
|
811
|
+
return _context24.stop();
|
|
745
812
|
}
|
|
746
|
-
},
|
|
813
|
+
}, _callee24);
|
|
747
814
|
})));
|
|
748
|
-
it('Simulate a network flap with no active calls and re-verify registration: Restore Failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
815
|
+
it('Simulate a network flap with no active calls and re-verify registration: Restore Failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
749
816
|
var failurePayload, mockRegistrationBody, successPayload;
|
|
750
|
-
return _regenerator.default.wrap(function
|
|
751
|
-
while (1) switch (
|
|
817
|
+
return _regenerator.default.wrap(function _callee25$(_context25) {
|
|
818
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
752
819
|
case 0:
|
|
753
820
|
expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
|
|
754
821
|
failurePayload = {
|
|
@@ -776,7 +843,7 @@ describe('CallingClient Tests', function () {
|
|
|
776
843
|
webex.internal.mercury.connected = true;
|
|
777
844
|
logSpy.mockReset();
|
|
778
845
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
779
|
-
|
|
846
|
+
_context25.next = 13;
|
|
780
847
|
return flushPromises();
|
|
781
848
|
case 13:
|
|
782
849
|
_Logger.default.info('Mercury connection is up again, re-registering with Webex Calling if needed', {
|
|
@@ -796,14 +863,14 @@ describe('CallingClient Tests', function () {
|
|
|
796
863
|
expect(registerSpy).toHaveBeenCalledWith('handleConnectionRestoration', [_callingClientFixtures.primaryUrl]);
|
|
797
864
|
case 20:
|
|
798
865
|
case "end":
|
|
799
|
-
return
|
|
866
|
+
return _context25.stop();
|
|
800
867
|
}
|
|
801
|
-
},
|
|
868
|
+
}, _callee25);
|
|
802
869
|
})));
|
|
803
|
-
it('Simulate a network flap before initial registration is done', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
870
|
+
it('Simulate a network flap before initial registration is done', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
804
871
|
var handleConnectionRestoreSpy;
|
|
805
|
-
return _regenerator.default.wrap(function
|
|
806
|
-
while (1) switch (
|
|
872
|
+
return _regenerator.default.wrap(function _callee26$(_context26) {
|
|
873
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
807
874
|
case 0:
|
|
808
875
|
warnSpy.mockClear();
|
|
809
876
|
handleConnectionRestoreSpy = jest.spyOn(reg, 'handleConnectionRestoration');
|
|
@@ -822,7 +889,7 @@ describe('CallingClient Tests', function () {
|
|
|
822
889
|
/* Set mercury connection to be up and execute a delay of 2.5 seconds */
|
|
823
890
|
webex.internal.mercury.connected = true;
|
|
824
891
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
825
|
-
|
|
892
|
+
_context26.next = 10;
|
|
826
893
|
return flushPromises();
|
|
827
894
|
case 10:
|
|
828
895
|
/* We should be detecting the network recovery */
|
|
@@ -838,13 +905,13 @@ describe('CallingClient Tests', function () {
|
|
|
838
905
|
expect(handleConnectionRestoreSpy).not.toBeCalledOnceWith();
|
|
839
906
|
case 12:
|
|
840
907
|
case "end":
|
|
841
|
-
return
|
|
908
|
+
return _context26.stop();
|
|
842
909
|
}
|
|
843
|
-
},
|
|
910
|
+
}, _callee26);
|
|
844
911
|
})));
|
|
845
|
-
it('Simulate a network flap with 1 active call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
846
|
-
return _regenerator.default.wrap(function
|
|
847
|
-
while (1) switch (
|
|
912
|
+
it('Simulate a network flap with 1 active call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
913
|
+
return _regenerator.default.wrap(function _callee27$(_context27) {
|
|
914
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
848
915
|
case 0:
|
|
849
916
|
expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
|
|
850
917
|
|
|
@@ -855,7 +922,7 @@ describe('CallingClient Tests', function () {
|
|
|
855
922
|
/* Set mercury connection to be down and execute a delay of 2.5 seconds */
|
|
856
923
|
webex.internal.mercury.connected = false;
|
|
857
924
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
858
|
-
|
|
925
|
+
_context27.next = 7;
|
|
859
926
|
return flushPromises();
|
|
860
927
|
case 7:
|
|
861
928
|
/* We should be detecting the network flap */
|
|
@@ -867,7 +934,7 @@ describe('CallingClient Tests', function () {
|
|
|
867
934
|
/* Set mercury connection to be up and execute a delay of 2.5 seconds */
|
|
868
935
|
webex.internal.mercury.connected = true;
|
|
869
936
|
jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
|
|
870
|
-
|
|
937
|
+
_context27.next = 12;
|
|
871
938
|
return flushPromises();
|
|
872
939
|
case 12:
|
|
873
940
|
/* We should be detecting the network recovery */
|
|
@@ -878,28 +945,28 @@ describe('CallingClient Tests', function () {
|
|
|
878
945
|
expect(registerSpy).not.toBeCalledWith(true);
|
|
879
946
|
case 14:
|
|
880
947
|
case "end":
|
|
881
|
-
return
|
|
948
|
+
return _context27.stop();
|
|
882
949
|
}
|
|
883
|
-
},
|
|
950
|
+
}, _callee27);
|
|
884
951
|
})));
|
|
885
952
|
});
|
|
886
953
|
describe('Line creation tests', function () {
|
|
887
954
|
var callingClient;
|
|
888
955
|
var line;
|
|
889
|
-
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
890
|
-
return _regenerator.default.wrap(function
|
|
891
|
-
while (1) switch (
|
|
956
|
+
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
957
|
+
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
958
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
892
959
|
case 0:
|
|
893
|
-
|
|
960
|
+
_context28.next = 2;
|
|
894
961
|
return (0, _CallingClient.createClient)(webex);
|
|
895
962
|
case 2:
|
|
896
|
-
callingClient =
|
|
963
|
+
callingClient = _context28.sent;
|
|
897
964
|
line = (0, _values.default)(callingClient.lineDict)[0];
|
|
898
965
|
case 4:
|
|
899
966
|
case "end":
|
|
900
|
-
return
|
|
967
|
+
return _context28.stop();
|
|
901
968
|
}
|
|
902
|
-
},
|
|
969
|
+
}, _callee28);
|
|
903
970
|
})));
|
|
904
971
|
afterEach(function () {
|
|
905
972
|
jest.clearAllTimers();
|
|
@@ -934,15 +1001,15 @@ describe('CallingClient Tests', function () {
|
|
|
934
1001
|
});
|
|
935
1002
|
var callingClient;
|
|
936
1003
|
var line;
|
|
937
|
-
beforeAll( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1004
|
+
beforeAll( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
938
1005
|
var calls;
|
|
939
|
-
return _regenerator.default.wrap(function
|
|
940
|
-
while (1) switch (
|
|
1006
|
+
return _regenerator.default.wrap(function _callee29$(_context29) {
|
|
1007
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
941
1008
|
case 0:
|
|
942
|
-
|
|
1009
|
+
_context29.next = 2;
|
|
943
1010
|
return (0, _CallingClient.createClient)(webex);
|
|
944
1011
|
case 2:
|
|
945
|
-
callingClient =
|
|
1012
|
+
callingClient = _context29.sent;
|
|
946
1013
|
line = new _line.default(userId, clientDeviceUri, mutex, primaryMobiusUris(), backupMobiusUris(), _types.LOGGER.INFO);
|
|
947
1014
|
calls = (0, _values.default)(callManager.getActiveCalls());
|
|
948
1015
|
calls.forEach(function (call) {
|
|
@@ -950,9 +1017,9 @@ describe('CallingClient Tests', function () {
|
|
|
950
1017
|
});
|
|
951
1018
|
case 6:
|
|
952
1019
|
case "end":
|
|
953
|
-
return
|
|
1020
|
+
return _context29.stop();
|
|
954
1021
|
}
|
|
955
|
-
},
|
|
1022
|
+
}, _callee29);
|
|
956
1023
|
})));
|
|
957
1024
|
afterAll(function () {
|
|
958
1025
|
callingClient.removeAllListeners();
|
|
@@ -1035,23 +1102,23 @@ describe('CallingClient Tests', function () {
|
|
|
1035
1102
|
describe('Call Session Event test', function () {
|
|
1036
1103
|
var mockOn = webex.internal.mercury.on;
|
|
1037
1104
|
var callingClient;
|
|
1038
|
-
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1039
|
-
return _regenerator.default.wrap(function
|
|
1040
|
-
while (1) switch (
|
|
1105
|
+
beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1106
|
+
return _regenerator.default.wrap(function _callee30$(_context30) {
|
|
1107
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1041
1108
|
case 0:
|
|
1042
|
-
|
|
1109
|
+
_context30.next = 2;
|
|
1043
1110
|
return (0, _CallingClient.createClient)(webex, {
|
|
1044
1111
|
logger: {
|
|
1045
1112
|
level: _types.LOGGER.INFO
|
|
1046
1113
|
}
|
|
1047
1114
|
});
|
|
1048
1115
|
case 2:
|
|
1049
|
-
callingClient =
|
|
1116
|
+
callingClient = _context30.sent;
|
|
1050
1117
|
case 3:
|
|
1051
1118
|
case "end":
|
|
1052
|
-
return
|
|
1119
|
+
return _context30.stop();
|
|
1053
1120
|
}
|
|
1054
|
-
},
|
|
1121
|
+
}, _callee30);
|
|
1055
1122
|
})));
|
|
1056
1123
|
afterEach(function () {
|
|
1057
1124
|
callingClient.removeAllListeners();
|
|
@@ -1078,5 +1145,92 @@ describe('CallingClient Tests', function () {
|
|
|
1078
1145
|
callSessionCallback(_callRecordFixtures.MOCK_MULTIPLE_SESSIONS_EVENT);
|
|
1079
1146
|
});
|
|
1080
1147
|
});
|
|
1148
|
+
describe('windowsChromiumIceWarmup', function () {
|
|
1149
|
+
var origRTCPeerConnection;
|
|
1150
|
+
beforeAll(function () {
|
|
1151
|
+
var _class;
|
|
1152
|
+
origRTCPeerConnection = global.RTCPeerConnection;
|
|
1153
|
+
// Minimal mock for RTCPeerConnection
|
|
1154
|
+
global.RTCPeerConnection = (_class = /*#__PURE__*/function () {
|
|
1155
|
+
function _class() {
|
|
1156
|
+
(0, _classCallCheck2.default)(this, _class);
|
|
1157
|
+
(0, _defineProperty2.default)(this, "iceGatheringState", 'complete');
|
|
1158
|
+
(0, _defineProperty2.default)(this, "localDescription", null);
|
|
1159
|
+
(0, _defineProperty2.default)(this, "remoteDescription", null);
|
|
1160
|
+
(0, _defineProperty2.default)(this, "onicecandidate", null);
|
|
1161
|
+
this.constructor.instances.push(this);
|
|
1162
|
+
}
|
|
1163
|
+
(0, _createClass2.default)(_class, [{
|
|
1164
|
+
key: "createDataChannel",
|
|
1165
|
+
value: function createDataChannel() {
|
|
1166
|
+
return {};
|
|
1167
|
+
}
|
|
1168
|
+
}, {
|
|
1169
|
+
key: "addTransceiver",
|
|
1170
|
+
value: function addTransceiver() {
|
|
1171
|
+
return {};
|
|
1172
|
+
}
|
|
1173
|
+
}, {
|
|
1174
|
+
key: "createOffer",
|
|
1175
|
+
value: function createOffer() {
|
|
1176
|
+
return _promise.default.resolve({
|
|
1177
|
+
sdp: 'offer',
|
|
1178
|
+
type: 'offer'
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
}, {
|
|
1182
|
+
key: "setLocalDescription",
|
|
1183
|
+
value: function setLocalDescription(desc) {
|
|
1184
|
+
this.localDescription = desc;
|
|
1185
|
+
return _promise.default.resolve();
|
|
1186
|
+
}
|
|
1187
|
+
}, {
|
|
1188
|
+
key: "setRemoteDescription",
|
|
1189
|
+
value: function setRemoteDescription(desc) {
|
|
1190
|
+
this.remoteDescription = desc;
|
|
1191
|
+
return _promise.default.resolve();
|
|
1192
|
+
}
|
|
1193
|
+
}, {
|
|
1194
|
+
key: "createAnswer",
|
|
1195
|
+
value: function createAnswer() {
|
|
1196
|
+
return _promise.default.resolve({
|
|
1197
|
+
sdp: 'answer',
|
|
1198
|
+
type: 'answer'
|
|
1199
|
+
});
|
|
1200
|
+
}
|
|
1201
|
+
}, {
|
|
1202
|
+
key: "addIceCandidate",
|
|
1203
|
+
value: function addIceCandidate() {
|
|
1204
|
+
return _promise.default.resolve();
|
|
1205
|
+
}
|
|
1206
|
+
}, {
|
|
1207
|
+
key: "close",
|
|
1208
|
+
value: function close() {}
|
|
1209
|
+
}, {
|
|
1210
|
+
key: "addEventListener",
|
|
1211
|
+
value: function addEventListener() {}
|
|
1212
|
+
}, {
|
|
1213
|
+
key: "removeEventListener",
|
|
1214
|
+
value: function removeEventListener() {}
|
|
1215
|
+
}]);
|
|
1216
|
+
return _class;
|
|
1217
|
+
}(), (0, _defineProperty2.default)(_class, "instances", []), _class);
|
|
1218
|
+
});
|
|
1219
|
+
afterAll(function () {
|
|
1220
|
+
global.RTCPeerConnection = origRTCPeerConnection;
|
|
1221
|
+
});
|
|
1222
|
+
it('should complete without throwing', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1223
|
+
return _regenerator.default.wrap(function _callee31$(_context31) {
|
|
1224
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1225
|
+
case 0:
|
|
1226
|
+
_context31.next = 2;
|
|
1227
|
+
return expect((0, _windowsChromiumIceWarmupUtils.default)({})).resolves.not.toThrow();
|
|
1228
|
+
case 2:
|
|
1229
|
+
case "end":
|
|
1230
|
+
return _context31.stop();
|
|
1231
|
+
}
|
|
1232
|
+
}, _callee31);
|
|
1233
|
+
})));
|
|
1234
|
+
});
|
|
1081
1235
|
});
|
|
1082
1236
|
//# sourceMappingURL=CallingClient.test.js.map
|