@webex/calling 3.8.1 → 3.9.0-multipleLLM.2

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.
Files changed (83) hide show
  1. package/dist/CallSettings/WxCallBackendConnector.js +2 -2
  2. package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
  3. package/dist/CallSettings/WxCallBackendConnector.test.js +94 -27
  4. package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
  5. package/dist/CallSettings/types.js.map +1 -1
  6. package/dist/CallingClient/CallingClient.js +186 -111
  7. package/dist/CallingClient/CallingClient.js.map +1 -1
  8. package/dist/CallingClient/CallingClient.test.js +258 -102
  9. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  10. package/dist/CallingClient/calling/call.js +26 -13
  11. package/dist/CallingClient/calling/call.js.map +1 -1
  12. package/dist/CallingClient/calling/call.test.js +8 -6
  13. package/dist/CallingClient/calling/call.test.js.map +1 -1
  14. package/dist/CallingClient/constants.js +4 -3
  15. package/dist/CallingClient/constants.js.map +1 -1
  16. package/dist/CallingClient/line/index.js +3 -4
  17. package/dist/CallingClient/line/index.js.map +1 -1
  18. package/dist/CallingClient/line/line.test.js +6 -11
  19. package/dist/CallingClient/line/line.test.js.map +1 -1
  20. package/dist/CallingClient/registration/register.js +486 -380
  21. package/dist/CallingClient/registration/register.js.map +1 -1
  22. package/dist/CallingClient/registration/register.test.js +441 -309
  23. package/dist/CallingClient/registration/register.test.js.map +1 -1
  24. package/dist/CallingClient/registration/types.js.map +1 -1
  25. package/dist/CallingClient/registration/webWorker.js +115 -0
  26. package/dist/CallingClient/registration/webWorker.js.map +1 -0
  27. package/dist/CallingClient/registration/webWorker.test.js +256 -0
  28. package/dist/CallingClient/registration/webWorker.test.js.map +1 -0
  29. package/dist/CallingClient/registration/webWorkerStr.js +15 -0
  30. package/dist/CallingClient/registration/webWorkerStr.js.map +1 -0
  31. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +146 -0
  32. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -0
  33. package/dist/Errors/types.js +2 -0
  34. package/dist/Errors/types.js.map +1 -1
  35. package/dist/Metrics/index.js +77 -74
  36. package/dist/Metrics/index.js.map +1 -1
  37. package/dist/Metrics/index.test.js +70 -4
  38. package/dist/Metrics/index.test.js.map +1 -1
  39. package/dist/Metrics/types.js.map +1 -1
  40. package/dist/common/Utils.js +46 -37
  41. package/dist/common/Utils.js.map +1 -1
  42. package/dist/common/Utils.test.js +281 -132
  43. package/dist/common/Utils.test.js.map +1 -1
  44. package/dist/common/types.js +8 -1
  45. package/dist/common/types.js.map +1 -1
  46. package/dist/module/CallSettings/WxCallBackendConnector.js +1 -1
  47. package/dist/module/CallingClient/CallingClient.js +39 -10
  48. package/dist/module/CallingClient/calling/call.js +13 -0
  49. package/dist/module/CallingClient/constants.js +3 -2
  50. package/dist/module/CallingClient/line/index.js +3 -3
  51. package/dist/module/CallingClient/registration/register.js +102 -66
  52. package/dist/module/CallingClient/registration/webWorker.js +59 -0
  53. package/dist/module/CallingClient/registration/webWorkerStr.js +93 -0
  54. package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +62 -0
  55. package/dist/module/Errors/types.js +2 -0
  56. package/dist/module/Metrics/index.js +31 -32
  57. package/dist/module/common/Utils.js +15 -4
  58. package/dist/module/common/types.js +7 -0
  59. package/dist/types/CallSettings/types.d.ts +1 -1
  60. package/dist/types/CallSettings/types.d.ts.map +1 -1
  61. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  62. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  63. package/dist/types/CallingClient/constants.d.ts +3 -2
  64. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  65. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  66. package/dist/types/CallingClient/registration/register.d.ts +2 -2
  67. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  68. package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
  69. package/dist/types/CallingClient/registration/webWorker.d.ts +2 -0
  70. package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -0
  71. package/dist/types/CallingClient/registration/webWorkerStr.d.ts +3 -0
  72. package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -0
  73. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +7 -0
  74. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -0
  75. package/dist/types/Errors/types.d.ts +2 -0
  76. package/dist/types/Errors/types.d.ts.map +1 -1
  77. package/dist/types/Metrics/index.d.ts.map +1 -1
  78. package/dist/types/Metrics/types.d.ts +3 -2
  79. package/dist/types/Metrics/types.d.ts.map +1 -1
  80. package/dist/types/common/Utils.d.ts.map +1 -1
  81. package/dist/types/common/types.d.ts +13 -0
  82. package/dist/types/common/types.d.ts.map +1 -1
  83. package/package.json +4 -4
@@ -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.mockRejectedValueOnce(failurePayload);
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 region discovery succeeds but region based mobius url discovery fails', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
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: 500
521
+ statusCode: 401
528
522
  };
529
- webex.request.mockResolvedValueOnce(_callingClientFixtures.ipPayload).mockResolvedValueOnce(_callingClientFixtures.regionPayload).mockRejectedValueOnce(failurePayload);
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 _context17.stop();
585
+ return _context18.stop();
559
586
  }
560
- }, _callee17);
587
+ }, _callee18);
561
588
  })));
562
- it('Verify successful mobius server url discovery after initializing callingClient through a config', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
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);
628
+ })));
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 _callee18$(_context18) {
565
- while (1) switch (_context18.prev = _context18.next) {
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
- _context18.next = 5;
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 = _context18.sent;
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 _context18.stop();
661
+ return _context20.stop();
595
662
  }
596
- }, _callee18);
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 _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(mockServiceHosts, mockCatalog) {
669
+ var _ref21 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(mockServiceHosts, mockCatalog) {
603
670
  var callingClient;
604
- return _regenerator.default.wrap(function _callee19$(_context19) {
605
- while (1) switch (_context19.prev = _context19.next) {
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
- _context19.next = 3;
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 = _context19.sent;
682
+ callingClient = _context21.sent;
616
683
  expect(callingClient['mobiusClusters']).toStrictEqual(mockServiceHosts);
617
684
  case 5:
618
685
  case "end":
619
- return _context19.stop();
686
+ return _context21.stop();
620
687
  }
621
- }, _callee19);
688
+ }, _callee21);
622
689
  }));
623
690
  return function checkCluster(_x, _x2) {
624
- return _ref19.apply(this, arguments);
691
+ return _ref21.apply(this, arguments);
625
692
  };
626
693
  }();
627
694
  it.each(mobiusCluster)('%s', /*#__PURE__*/function () {
628
- var _ref20 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(clusterName) {
629
- return _regenerator.default.wrap(function _callee20$(_context20) {
630
- while (1) switch (_context20.prev = _context20.next) {
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
- _context20.t0 = clusterName;
633
- _context20.next = _context20.t0 === 'mobius-eu-central-1.prod.infra.webex.com' ? 3 : _context20.t0 === 'mobius-us-east-1.int.infra.webex.com' ? 5 : _context20.t0 === 'mobius-eu-central-1.int.infra.webex.com' ? 7 : 9;
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 _context20.abrupt("break", 10);
704
+ return _context22.abrupt("break", 10);
638
705
  case 5:
639
706
  checkCluster(_callingClientFixtures.mockIntServiceHosts, _callingClientFixtures.mockCatalogUSInt);
640
- return _context20.abrupt("break", 10);
707
+ return _context22.abrupt("break", 10);
641
708
  case 7:
642
709
  checkCluster(_callingClientFixtures.mockEUIntServiceHosts, _callingClientFixtures.mockCatalogEUInt);
643
- return _context20.abrupt("break", 10);
710
+ return _context22.abrupt("break", 10);
644
711
  case 9:
645
- return _context20.abrupt("break", 10);
712
+ return _context22.abrupt("break", 10);
646
713
  case 10:
647
714
  case "end":
648
- return _context20.stop();
715
+ return _context22.stop();
649
716
  }
650
- }, _callee20);
717
+ }, _callee22);
651
718
  }));
652
719
  return function (_x3) {
653
- return _ref20.apply(this, arguments);
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 _callee21() {
667
- return _regenerator.default.wrap(function _callee21$(_context21) {
668
- while (1) switch (_context21.prev = _context21.next) {
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
- _context21.next = 4;
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 = _context21.sent;
746
+ callingClient = _context23.sent;
680
747
  line = (0, _values.default)(callingClient.lineDict)[0];
681
748
  reg = line.registration;
682
- _context21.next = 9;
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 _context21.stop();
758
+ return _context23.stop();
692
759
  }
693
- }, _callee21);
760
+ }, _callee23);
694
761
  })));
695
762
  afterEach(function () {
696
763
  jest.clearAllTimers();
@@ -700,10 +767,11 @@ 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 _callee22() {
704
- return _regenerator.default.wrap(function _callee22$(_context22) {
705
- while (1) switch (_context22.prev = _context22.next) {
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:
774
+ warnSpy.mockClear();
707
775
  expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
708
776
 
709
777
  /* Set mercury connection to be down and execute a delay of 2.5 seconds */
@@ -720,9 +788,9 @@ describe('CallingClient Tests', function () {
720
788
  webex.internal.mercury.connected = true;
721
789
  logSpy.mockReset();
722
790
  jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
723
- _context22.next = 9;
791
+ _context24.next = 10;
724
792
  return flushPromises();
725
- case 9:
793
+ case 10:
726
794
  _Logger.default.info('Mercury connection is up again, re-registering with Webex Calling if needed', {
727
795
  file: _constants.REGISTRATION_FILE,
728
796
  method: 'handleConnectionRestoration'
@@ -738,16 +806,16 @@ describe('CallingClient Tests', function () {
738
806
  expect(webex.request).toHaveBeenCalledTimes(6);
739
807
  expect(registerSpy).toHaveBeenCalledWith('handleConnectionRestoration', [reg.getActiveMobiusUrl()]);
740
808
  expect(registerSpy).toHaveBeenCalledWith('handleConnectionRestoration', [_callingClientFixtures.primaryUrl]);
741
- case 16:
809
+ case 17:
742
810
  case "end":
743
- return _context22.stop();
811
+ return _context24.stop();
744
812
  }
745
- }, _callee22);
813
+ }, _callee24);
746
814
  })));
747
- it('Simulate a network flap with no active calls and re-verify registration: Restore Failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
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() {
748
816
  var failurePayload, mockRegistrationBody, successPayload;
749
- return _regenerator.default.wrap(function _callee23$(_context23) {
750
- while (1) switch (_context23.prev = _context23.next) {
817
+ return _regenerator.default.wrap(function _callee25$(_context25) {
818
+ while (1) switch (_context25.prev = _context25.next) {
751
819
  case 0:
752
820
  expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
753
821
  failurePayload = {
@@ -775,7 +843,7 @@ describe('CallingClient Tests', function () {
775
843
  webex.internal.mercury.connected = true;
776
844
  logSpy.mockReset();
777
845
  jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
778
- _context23.next = 13;
846
+ _context25.next = 13;
779
847
  return flushPromises();
780
848
  case 13:
781
849
  _Logger.default.info('Mercury connection is up again, re-registering with Webex Calling if needed', {
@@ -795,15 +863,16 @@ describe('CallingClient Tests', function () {
795
863
  expect(registerSpy).toHaveBeenCalledWith('handleConnectionRestoration', [_callingClientFixtures.primaryUrl]);
796
864
  case 20:
797
865
  case "end":
798
- return _context23.stop();
866
+ return _context25.stop();
799
867
  }
800
- }, _callee23);
868
+ }, _callee25);
801
869
  })));
802
- it('Simulate a network flap before initial registration is done', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
870
+ it('Simulate a network flap before initial registration is done', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
803
871
  var handleConnectionRestoreSpy;
804
- return _regenerator.default.wrap(function _callee24$(_context24) {
805
- while (1) switch (_context24.prev = _context24.next) {
872
+ return _regenerator.default.wrap(function _callee26$(_context26) {
873
+ while (1) switch (_context26.prev = _context26.next) {
806
874
  case 0:
875
+ warnSpy.mockClear();
807
876
  handleConnectionRestoreSpy = jest.spyOn(reg, 'handleConnectionRestoration');
808
877
  reg.setStatus(_types2.RegistrationStatus.IDLE);
809
878
 
@@ -820,9 +889,9 @@ describe('CallingClient Tests', function () {
820
889
  /* Set mercury connection to be up and execute a delay of 2.5 seconds */
821
890
  webex.internal.mercury.connected = true;
822
891
  jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
823
- _context24.next = 9;
892
+ _context26.next = 10;
824
893
  return flushPromises();
825
- case 9:
894
+ case 10:
826
895
  /* We should be detecting the network recovery */
827
896
  expect(logSpy).not.toBeCalledWith('Mercury connection is up again, re-registering with Webex Calling if needed', {
828
897
  file: _constants.REGISTRATION_FILE,
@@ -834,15 +903,15 @@ describe('CallingClient Tests', function () {
834
903
  * will not trigger de-registration/registration
835
904
  */
836
905
  expect(handleConnectionRestoreSpy).not.toBeCalledOnceWith();
837
- case 11:
906
+ case 12:
838
907
  case "end":
839
- return _context24.stop();
908
+ return _context26.stop();
840
909
  }
841
- }, _callee24);
910
+ }, _callee26);
842
911
  })));
843
- it('Simulate a network flap with 1 active call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
844
- return _regenerator.default.wrap(function _callee25$(_context25) {
845
- while (1) switch (_context25.prev = _context25.next) {
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) {
846
915
  case 0:
847
916
  expect(line.getStatus()).toEqual(_types2.RegistrationStatus.ACTIVE);
848
917
 
@@ -853,7 +922,7 @@ describe('CallingClient Tests', function () {
853
922
  /* Set mercury connection to be down and execute a delay of 2.5 seconds */
854
923
  webex.internal.mercury.connected = false;
855
924
  jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
856
- _context25.next = 7;
925
+ _context27.next = 7;
857
926
  return flushPromises();
858
927
  case 7:
859
928
  /* We should be detecting the network flap */
@@ -865,7 +934,7 @@ describe('CallingClient Tests', function () {
865
934
  /* Set mercury connection to be up and execute a delay of 2.5 seconds */
866
935
  webex.internal.mercury.connected = true;
867
936
  jest.advanceTimersByTime(_constants.NETWORK_FLAP_TIMEOUT + 500);
868
- _context25.next = 12;
937
+ _context27.next = 12;
869
938
  return flushPromises();
870
939
  case 12:
871
940
  /* We should be detecting the network recovery */
@@ -876,28 +945,28 @@ describe('CallingClient Tests', function () {
876
945
  expect(registerSpy).not.toBeCalledWith(true);
877
946
  case 14:
878
947
  case "end":
879
- return _context25.stop();
948
+ return _context27.stop();
880
949
  }
881
- }, _callee25);
950
+ }, _callee27);
882
951
  })));
883
952
  });
884
953
  describe('Line creation tests', function () {
885
954
  var callingClient;
886
955
  var line;
887
- beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
888
- return _regenerator.default.wrap(function _callee26$(_context26) {
889
- while (1) switch (_context26.prev = _context26.next) {
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) {
890
959
  case 0:
891
- _context26.next = 2;
960
+ _context28.next = 2;
892
961
  return (0, _CallingClient.createClient)(webex);
893
962
  case 2:
894
- callingClient = _context26.sent;
963
+ callingClient = _context28.sent;
895
964
  line = (0, _values.default)(callingClient.lineDict)[0];
896
965
  case 4:
897
966
  case "end":
898
- return _context26.stop();
967
+ return _context28.stop();
899
968
  }
900
- }, _callee26);
969
+ }, _callee28);
901
970
  })));
902
971
  afterEach(function () {
903
972
  jest.clearAllTimers();
@@ -932,15 +1001,15 @@ describe('CallingClient Tests', function () {
932
1001
  });
933
1002
  var callingClient;
934
1003
  var line;
935
- beforeAll( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
1004
+ beforeAll( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
936
1005
  var calls;
937
- return _regenerator.default.wrap(function _callee27$(_context27) {
938
- while (1) switch (_context27.prev = _context27.next) {
1006
+ return _regenerator.default.wrap(function _callee29$(_context29) {
1007
+ while (1) switch (_context29.prev = _context29.next) {
939
1008
  case 0:
940
- _context27.next = 2;
1009
+ _context29.next = 2;
941
1010
  return (0, _CallingClient.createClient)(webex);
942
1011
  case 2:
943
- callingClient = _context27.sent;
1012
+ callingClient = _context29.sent;
944
1013
  line = new _line.default(userId, clientDeviceUri, mutex, primaryMobiusUris(), backupMobiusUris(), _types.LOGGER.INFO);
945
1014
  calls = (0, _values.default)(callManager.getActiveCalls());
946
1015
  calls.forEach(function (call) {
@@ -948,9 +1017,9 @@ describe('CallingClient Tests', function () {
948
1017
  });
949
1018
  case 6:
950
1019
  case "end":
951
- return _context27.stop();
1020
+ return _context29.stop();
952
1021
  }
953
- }, _callee27);
1022
+ }, _callee29);
954
1023
  })));
955
1024
  afterAll(function () {
956
1025
  callingClient.removeAllListeners();
@@ -1033,23 +1102,23 @@ describe('CallingClient Tests', function () {
1033
1102
  describe('Call Session Event test', function () {
1034
1103
  var mockOn = webex.internal.mercury.on;
1035
1104
  var callingClient;
1036
- beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
1037
- return _regenerator.default.wrap(function _callee28$(_context28) {
1038
- while (1) switch (_context28.prev = _context28.next) {
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) {
1039
1108
  case 0:
1040
- _context28.next = 2;
1109
+ _context30.next = 2;
1041
1110
  return (0, _CallingClient.createClient)(webex, {
1042
1111
  logger: {
1043
1112
  level: _types.LOGGER.INFO
1044
1113
  }
1045
1114
  });
1046
1115
  case 2:
1047
- callingClient = _context28.sent;
1116
+ callingClient = _context30.sent;
1048
1117
  case 3:
1049
1118
  case "end":
1050
- return _context28.stop();
1119
+ return _context30.stop();
1051
1120
  }
1052
- }, _callee28);
1121
+ }, _callee30);
1053
1122
  })));
1054
1123
  afterEach(function () {
1055
1124
  callingClient.removeAllListeners();
@@ -1076,5 +1145,92 @@ describe('CallingClient Tests', function () {
1076
1145
  callSessionCallback(_callRecordFixtures.MOCK_MULTIPLE_SESSIONS_EVENT);
1077
1146
  });
1078
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
+ });
1079
1235
  });
1080
1236
  //# sourceMappingURL=CallingClient.test.js.map