Bug 1162720 - test enumerateDevices. r=jesup

This commit is contained in:
Jan-Ivar Bruaroey 2015-05-14 07:25:32 -04:00
parent 445db4af9c
commit 1663bdca94
2 changed files with 34 additions and 0 deletions

View File

@ -29,6 +29,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,32 @@
<!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(function() {
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");
});
})
.catch(e => ok(false, "Unexpected failure: " + e.name + ", " + e.message))
.then(SimpleTest.finish);
});
</script>
</pre>
</body>
</html>