gecko/dom/media/tests/mochitest/test_peerConnection_capturedVideo.html
Byron Campen [:bwc] 3a680bf820 Bug 1017888 - Part 2: Testing for renegotiation. r=mt, r=drno
--HG--
extra : rebase_source : 7434ef35ea6294966220f20431941e0790c4221c
2015-02-10 10:17:03 -08:00

49 lines
1.4 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>
<video id="v1" src="../../test/vp9cake.webm" height="120" width="160" autoplay muted></video>
<pre id="test">
<script type="application/javascript;version=1.8">
createHTML({
bug: "1081409",
title: "Captured video-only over peer connection",
visible: true
});
var metadataLoaded = new Promise(resolve => {
if (v1.readyState < v1.HAVE_METADATA) {
v1.onloadedmetadata = resolve;
} else {
resolve();
}
});
runNetworkTest(function() {
var test = new PeerConnectionTest();
test.setOfferOptions({ offerToReceiveVideo: false,
offerToReceiveAudio: false });
test.chain.insertAfter("PC_LOCAL_GUM", [
function PC_LOCAL_CAPTUREVIDEO(test) {
return metadataLoaded
.then(() => {
var stream = v1.mozCaptureStreamUntilEnded();
is(stream.getTracks().length, 2, "Captured stream has 2 tracks");
stream.getTracks().forEach(tr => {
test.pcLocal._pc.addTrack(tr, stream);
test.pcLocal.expectedLocalTrackTypesById[tr.id] = tr.kind;
});
test.pcLocal.constraints = [{ video: true, audio:true }]; // fool tests
});
}
]);
test.chain.removeAfter("PC_REMOTE_CHECK_MEDIA_FLOW_PRESENT");
test.run();
});
</script>
</pre>
</body>
</html>