Bug 1162720 - Test enumerateDevices. r=jesup, r=drno

This commit is contained in:
Jan-Ivar Bruaroey 2015-05-21 20:42:03 -04:00
parent bd3bcefb9f
commit 331f1e1871
2 changed files with 30 additions and 0 deletions

View File

@ -30,6 +30,8 @@ skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g(Bug 960442, video suppo
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g emulator seems to be too slow (Bug 1016498 and 1008080)
[test_dataChannel_noOffer.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g (Bug 1059867)
[test_enumerateDevices.html]
skip-if = buildapp == 'mulet'
[test_getUserMedia_basicAudio.html]
skip-if = (toolkit == 'gonk' || buildapp == 'mulet' && debug) # debug-only failure
[test_getUserMedia_basicVideo.html]

View File

@ -0,0 +1,28 @@
<!DOCTYPE HTML>
<html>
<head>
<script src="mediaStreamPlayback.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "Run enumerateDevices code", bug: "1046245" });
/**
Tests covering enumerateDevices API. Exercise code.
*/
runTest(() => navigator.mediaDevices.enumerateDevices()
.then(devices => {
ok(devices.length > 0, "At least one device found");
devices.forEach(d => {
ok(d.kind == "videoinput" || d.kind == "audioinput", "Known device kind");
is(d.deviceId.length, 44, "Correct device id length");
ok(d.label.length !== undefined, "Device label: " + d.label);
is(d.groupId, "", "Don't support groupId yet");
});
}));
</script>
</pre>
</body>
</html>