Bug 1296531 - Make sure test_pc_capturedVideo.html doesn't run out of source before connecting. r?jesup
MozReview-Commit-ID: EioemlMzYB7
--- a/dom/media/tests/mochitest/test_peerConnection_capturedVideo.html
+++ b/dom/media/tests/mochitest/test_peerConnection_capturedVideo.html
@@ -25,22 +25,23 @@ createHTML({
resolve();
};
}))
.catch(e => ok(false, "Unexpected " + e + ":\n" + e.stack));
function startTest(media, token) {
let manager = window.mediaTestManager;
manager.started(token);
+ info("Starting test for " + media.name);
var video = document.createElement('video');
video.id = "id_" + media.name;
video.width = 160;
video.height = 120;
video.muted = true;
- video.loop = true;
+ video.controls = true;
video.preload = "metadata";
video.src = "../../test/" + media.name;
document.getElementById("content").appendChild(video);
var test;
new Promise((resolve, reject) => {
video.onloadedmetadata = resolve;
@@ -57,18 +58,22 @@ function startTest(media, token) {
test.setOfferOptions({ offerToReceiveVideo: false,
offerToReceiveAudio: false });
var hasVideo = stream.getVideoTracks().length > 0;
var hasAudio = stream.getAudioTracks().length > 0;
test.setMediaConstraints([{ video: hasVideo, audio: hasAudio }], []);
test.chain.replace("PC_LOCAL_GUM", [
function PC_LOCAL_CAPTUREVIDEO(test) {
test.pcLocal.attachLocalStream(stream);
+ },
+ ]);
+ test.chain.insertBefore("PC_LOCAL_WAIT_FOR_MEDIA_FLOW", [
+ function PC_LOCAL_START_MEDIA(test) {
video.play();
- }
+ },
]);
return test.chain.execute();
});
})
// Handle both MediaErrors (with the `code` attribute) and other errors.
.catch(e => ok(false, "Error (" + e + ")" +
(e.code ? " (code=" + e.code + ")" : "") +
" in test for " + media.name +