Merge pull request #4616 from deepak1556/media_device_enumeration_patch
browser: allow enumeration of media device labels
This commit is contained in:
commit
b25c8ca621
3 changed files with 25 additions and 0 deletions
|
@ -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(
|
void WebContents::RequestMediaAccessPermission(
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
const content::MediaStreamRequest& request,
|
const content::MediaStreamRequest& request,
|
||||||
|
|
|
@ -202,6 +202,10 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
const gfx::Rect& selection_rect,
|
const gfx::Rect& selection_rect,
|
||||||
int active_match_ordinal,
|
int active_match_ordinal,
|
||||||
bool final_update) override;
|
bool final_update) override;
|
||||||
|
bool CheckMediaAccessPermission(
|
||||||
|
content::WebContents* web_contents,
|
||||||
|
const GURL& security_origin,
|
||||||
|
content::MediaStreamType type) override;
|
||||||
void RequestMediaAccessPermission(
|
void RequestMediaAccessPermission(
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
const content::MediaStreamRequest& request,
|
const content::MediaStreamRequest& request,
|
||||||
|
|
|
@ -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() {
|
describe('navigator.language', function() {
|
||||||
it('should not be empty', function() {
|
it('should not be empty', function() {
|
||||||
assert.notEqual(navigator.language, '');
|
assert.notEqual(navigator.language, '');
|
||||||
|
|
Loading…
Reference in a new issue