From 14076df5b47483e0320c896ffaa73ed4d9120ac8 Mon Sep 17 00:00:00 2001 From: Christoffer Jansson Date: Fri, 9 Mar 2018 16:14:53 +0100 Subject: [PATCH] Update deps and fix chrome automation --- karma.conf.js | 17 ++++++++++++++++- package.json | 10 +++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 5462c704c..58f8b838e 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,6 +1,7 @@ // Karma configuration module.exports = function(config) { - var browser = process.env.BROWSER || 'chrome'; + var browser = (process.env.BROWSER === '' || process.env.BROWSER === 'chrome') + ? 'Chrome_no_sandbox' : process.env.BROWSER var travis = process.env.TRAVIS; var files = function() { // List of tests that can run in "any" browser. @@ -26,6 +27,13 @@ module.exports = function(config) { } return filteredFiles; } + + let chromeFlags = [ + '--use-fake-device-for-media-stream', + '--use-fake-ui-for-media-stream', + '--no-sandbox', + '--headless', '--disable-gpu', '--remote-debugging-port=9222' + ]; config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) @@ -93,6 +101,13 @@ module.exports = function(config) { // https://npmjs.org/browse/keyword/karma-launcher browsers: [browser[0].toUpperCase() + browser.substr(1)], + customLaunchers: { + Chrome_no_sandbox: { + base: 'Chrome', + flags: chromeFlags + } + }, + // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: true, diff --git a/package.json b/package.json index b9844b8bc..46aa6b51b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ }, "devDependencies": { "eslint-config-webrtc": ">=1.0.0", - "grunt": ">=1.0.0", + "grunt": "^1.0.2", "grunt-cli": ">=0.1.9", "grunt-closurecompiler-new-grunt": ">=0.0.21", "grunt-contrib-compress": ">=1.0.0", @@ -22,15 +22,15 @@ "grunt-htmlhint": ">=0.9.12", "grunt-jinja-new-grunt": ">=0.3.0", "grunt-shell": ">=1.1.1", - "jasmine-core": ">=2.4.1", - "karma": ">=1.1.0", + "jasmine-core": "^3.1.0", + "karma": "^2.0.0", "karma-chrome-launcher": ">=1.0.1", "karma-cli": ">=1.0.1", "karma-eslint": ">=2.1.0", "karma-firefox-launcher": ">=1.0.0", "karma-jasmine": ">=1.0.2", - "travis-multirunner": "^4.2.5", - "webrtc-adapter": "^6.0.0" + "travis-multirunner": "^4.4.1", + "webrtc-adapter": "^6.1.3" }, "dependencies": { "pako": "^1.0.6"