diff options
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/capture_timeout.js')
-rw-r--r-- | vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/capture_timeout.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/capture_timeout.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/capture_timeout.js deleted file mode 100644 index fe0e166d..00000000 --- a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/capture_timeout.js +++ /dev/null @@ -1,44 +0,0 @@ -var log = require('../logger').create('launcher') - -/** - * Kill browser if it does not capture in given `captureTimeout`. - */ -var CaptureTimeoutLauncher = function (timer, captureTimeout) { - if (!captureTimeout) { - return - } - - var self = this - var pendingTimeoutId = null - - this.on('start', function () { - pendingTimeoutId = timer.setTimeout(function () { - pendingTimeoutId = null - if (self.state !== self.STATE_BEING_CAPTURED) { - return - } - - log.warn('%s have not captured in %d ms, killing.', self.name, captureTimeout) - self.error = 'timeout' - self.kill() - }, captureTimeout) - }) - - this.on('done', function () { - if (pendingTimeoutId) { - timer.clearTimeout(pendingTimeoutId) - pendingTimeoutId = null - } - }) -} - -CaptureTimeoutLauncher.decoratorFactory = function (timer, - /* config.captureTimeout */ captureTimeout) { - return function (launcher) { - CaptureTimeoutLauncher.call(launcher, timer, captureTimeout) - } -} - -CaptureTimeoutLauncher.decoratorFactory.$inject = ['timer', 'config.captureTimeout'] - -module.exports = CaptureTimeoutLauncher |