Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: content/test/data/media/getusermedia.html

Issue 2956063003: Add support for echoCancellation and deviceId to MediaStreamTrack.getSettings (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/test/data/media/getusermedia.html
diff --git a/content/test/data/media/getusermedia.html b/content/test/data/media/getusermedia.html
index e39912f06670b6380026a0016b87689c807435f7..ab9ab107ed5251fe0d0fef1d0dfdc0681a7d32d6 100644
--- a/content/test/data/media/getusermedia.html
+++ b/content/test/data/media/getusermedia.html
@@ -556,6 +556,62 @@
}
var detectorInterval = setInterval(detectorFunction, 50);
}
+
+ function GetAudioSettingsDefault() {
hbos_chromium 2017/07/04 15:26:49 JS function names should be lowerCamelCase.
Guido Urdaneta 2017/07/05 09:23:37 Done.
+ navigator.mediaDevices.getUserMedia({audio:true})
+ .then(stream => {
+ assertEquals(stream.getAudioTracks().length, 1);
+ var settings = stream.getAudioTracks()[0].getSettings();
+ assertEquals(settings.deviceId, 'default');
+ assertTrue(settings.echoCancellation);
+ stream.getAudioTracks()[0].stop();
+ reportTestSuccess();
+ })
+ .catch(_=>{
+ failTest("getUserMedia failed")
+ });
+ }
+
+ function GetAudioSettingsNoEchoCancellation() {
+ navigator.mediaDevices.getUserMedia({audio:{echoCancellation: false}})
+ .then(stream => {
+ assertEquals(stream.getAudioTracks().length, 1);
+ var settings = stream.getAudioTracks()[0].getSettings();
+ assertEquals(settings.deviceId, 'default');
+ assertEquals(settings.echoCancellation, false);
+ stream.getAudioTracks()[0].stop();
+ reportTestSuccess();
+ })
+ .catch(_=>{
+ failTest("getUserMedia failed")
+ });
+ }
+
+ function GetAudioSettingsDeviceId() {
+ navigator.mediaDevices.enumerateDevices()
+ .then(devices => {
+ var last_device_id;
+ for (var device, i = 0; device = devices[i]; ++i) {
+ if (device.kind != "audioinput")
+ continue;
+ last_device_id = device.deviceId;
+ }
+ navigator.mediaDevices.getUserMedia(
+ {audio:{deviceId: {exact: last_device_id}}})
+ .then(stream => {
+ assertEquals(stream.getAudioTracks().length, 1);
+ var settings = stream.getAudioTracks()[0].getSettings();
+ assertEquals(settings.deviceId, last_device_id);
+ assertNotEquals(settings.deviceId, 'default');
+ assertTrue(settings.echoCancellation);
+ stream.getAudioTracks()[0].stop();
+ reportTestSuccess();
+ })
+ })
+ .catch(e => {
+ failTest("Unexpected error: " + e)
+ });
+ }
</script>
</head>
<body>

Powered by Google App Engine
This is Rietveld 408576698