Bug 1304950 - Reduce timeslice to avoid races with the source ending. r?jwwang draft
authorAndreas Pehrson <pehrsons@gmail.com>
Wed, 12 Oct 2016 16:02:56 +0200
changeset 424367 d439612765b85908049434df57da1137b5c2723b
parent 423662 c83d97a27849a8b8e4359e872af3398766481613
child 533659 1e828f5e2f127cab67283082d7590a8b1d69d94e
push id32138
push userbmo:pehrson@telenordigital.com
push dateWed, 12 Oct 2016 17:48:23 +0000
reviewersjwwang
bugs1304950
milestone52.0a1
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
dom/media/test/test_mediarecorder_record_timeslice.html
--- 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);