From a4e04e6083a4f40fc8838571490ee00adb9e3596 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 4 Mar 2016 12:29:50 -0800 Subject: [PATCH 1/2] Always call done callback --- spec/chromium-spec.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index 8477aea776..0e3a836d39 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -94,10 +94,13 @@ describe('chromium feature', function() { it('can return labels of enumerated devices', function(done) { navigator.mediaDevices.enumerateDevices().then((devices) => { - const result = devices.some((device) => !!device.label); - if (result) + const labels = devices.map((device) => device.label); + const labelFound = labels.some((label) => !!label); + if (labelFound) done(); - }); + else + done('No device labels found: ' + JSON.stringify(labels)); + }).catch(done); }); }); From 20e9a871589369982b64c4b1c25885dcb34f29ab Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 4 Mar 2016 12:38:39 -0800 Subject: [PATCH 2/2] Don't run mediaDevices spec on Linux CI --- spec/chromium-spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index 0e3a836d39..67b2d26320 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -7,6 +7,8 @@ const remote = require('electron').remote; const BrowserWindow = remote.require('electron').BrowserWindow; const session = remote.require('electron').session; +const isCI = remote.getGlobal('isCi'); + describe('chromium feature', function() { var fixtures = path.resolve(__dirname, 'fixtures'); var listener = null; @@ -91,6 +93,9 @@ describe('chromium feature', function() { if (process.env.TRAVIS === 'true') { return; } + if (isCI && process.platform === 'linux') { + return; + } it('can return labels of enumerated devices', function(done) { navigator.mediaDevices.enumerateDevices().then((devices) => {