зеркало из https://github.com/mozilla/gecko-dev.git
Bug 962878: testcase: Modify the testcase since we can not guarantee the last onDataAvailble always has data. r=roc
This commit is contained in:
Родитель
03c8d42516
Коммит
5437f9b363
|
@ -364,7 +364,6 @@ skip-if = toolkit == 'gonk' && !debug # bug 1021677
|
|||
[test_mediarecorder_creation_fail.html]
|
||||
[test_mediarecorder_getencodeddata.html]
|
||||
[test_mediarecorder_record_4ch_audiocontext.html]
|
||||
skip-if = toolkit == 'gonk' && !debug # bug 1021678
|
||||
[test_mediarecorder_record_audiocontext.html]
|
||||
[test_mediarecorder_record_audiocontext_mlk.html]
|
||||
[test_mediarecorder_record_gum_video_timeslice.html]
|
||||
|
|
|
@ -26,6 +26,7 @@ function startTest() {
|
|||
var onstopTriggered = false;
|
||||
dest.channelCount = 4;
|
||||
var expectedMimeType = 'audio/ogg';
|
||||
var totalBlobSize = 0;
|
||||
source.channelCountMode = 'explicit';
|
||||
source.connect(dest);
|
||||
var elem = document.createElement('audio');
|
||||
|
@ -49,7 +50,11 @@ function startTest() {
|
|||
SimpleTest.finish();
|
||||
};
|
||||
mMediaRecorder.ondataavailable = function (e) {
|
||||
ok(e.data.size > 0, 'check blob has data');
|
||||
if (mMediaRecorder.state == 'recording') {
|
||||
ok(e.data.size > 0, 'check blob has data');
|
||||
}
|
||||
totalBlobSize += e.data.size;
|
||||
ok(totalBlobSize > 0, 'check the totalBlobSize');
|
||||
is(mMediaRecorder.mimeType, expectedMimeType, 'blob should has mimetype, return ' + mMediaRecorder.mimeType);
|
||||
if (!stopTriggered) {
|
||||
mMediaRecorder.stop();
|
||||
|
|
Загрузка…
Ссылка в новой задаче