diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 4935adbc75ad..28893a54a3dd 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -463,6 +463,13 @@ void WebContents::FindReply(content::WebContents* web_contents, } } +bool WebContents::CheckMediaAccessPermission( + content::WebContents* web_contents, + const GURL& security_origin, + content::MediaStreamType type) { + return true; +} + void WebContents::RequestMediaAccessPermission( content::WebContents* web_contents, const content::MediaStreamRequest& request, diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index b4f29090dbd3..a785e1c070db 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -202,6 +202,10 @@ class WebContents : public mate::TrackableObject, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) override; + bool CheckMediaAccessPermission( + content::WebContents* web_contents, + const GURL& security_origin, + content::MediaStreamType type) override; void RequestMediaAccessPermission( content::WebContents* web_contents, const content::MediaStreamRequest& request, diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index e4444f55b11d..8477aea776a2 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -87,6 +87,20 @@ describe('chromium feature', function() { }); }); + describe('navigator.mediaDevices', function() { + if (process.env.TRAVIS === 'true') { + return; + } + + it('can return labels of enumerated devices', function(done) { + navigator.mediaDevices.enumerateDevices().then((devices) => { + const result = devices.some((device) => !!device.label); + if (result) + done(); + }); + }); + }); + describe('navigator.language', function() { it('should not be empty', function() { assert.notEqual(navigator.language, '');