Bug 1304950 - Reduce timeslice to avoid races with the source ending. r?jwwang
Media element capture pushes data to MSG ahead of currentTime which together
with the direct listeners that we use in MediaRecorder we end up finishing
the recording in less than the 250ms that this test uses as the recording
timeslice.
Lowering the timeslice here seems to fix this. I'm using 1 here since it's the
minimum valid number.
MozReview-Commit-ID: KAlRoHWHPSV
--- a/dom/media/test/test_mediarecorder_record_timeslice.html
+++ b/dom/media/test/test_mediarecorder_record_timeslice.html
@@ -84,17 +84,17 @@ function startTest(test, token) {
'Media recorder stream = element stream post recording');
} else if (dataAvailableCount === 2) {
// Ensure we've received at least two ondataavailable events before onstop
onDataAvailableFirst = true;
}
};
- mediaRecorder.start(250);
+ mediaRecorder.start(1);
element.play();
is(mediaRecorder.state, 'recording', 'Media recorder should be recording');
is(mediaRecorder.stream, stream,
'Media recorder stream = element stream at the start of recording');
};
}
manager.runTests(gMediaRecorderTests, startTest);