Bug 1014393 - Minor mochitest fixes. r=jib

Differential Revision: https://phabricator.services.mozilla.com/D35311

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2019-07-12 13:41:45 +00:00
Родитель 8d5c8d17a4
Коммит a80b26a3f5
3 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -56,7 +56,8 @@ function startTest() {
}
totalBlobSize += e.data.size;
ok(totalBlobSize > 0, 'check the totalBlobSize');
is(mMediaRecorder.mimeType, expectedMimeType, 'blob should has mimetype, return ' + mMediaRecorder.mimeType);
is(e.data.type, expectedMimeType, 'blob should have expected mimetype');
is(mMediaRecorder.mimeType, expectedMimeType, 'recorder should have expected mimetype');
if (!stopTriggered) {
mMediaRecorder.stop();
stopTriggered = true;

Просмотреть файл

@ -65,7 +65,9 @@ async function testRecord(source, mimeType) {
const chunks = [];
let {data} = await new Promise(r => recorder.ondataavailable = r);
is(recorder.state, "recording", "Expected to still be recording");
if (!isOffline) {
is(recorder.state, "recording", "Expected to still be recording");
}
is(data.type, recorder.mimeType, "Blob has recorder mimetype");
if (mimeType != "") {
is(data.type, mimeType, "Blob has given mimetype");

Просмотреть файл

@ -38,13 +38,13 @@ function startTest(test, token) {
info('onstart fired successfully');
hasonstart = true;
// On audio only case, we produce audio/ogg as mimeType.
is('audio/ogg', mMediaRecorder.mimeType, "check the record mimetype return " + mMediaRecorder.mimeType);
is('audio/ogg', mMediaRecorder.mimeType, "MediaRecorder mimetype as expected");
mMediaRecorder.requestData();
};
mMediaRecorder.onstop = function() {
info('onstop fired successfully');
ok (hasondataavailable, "should have ondataavailable before onstop");
ok(hasondataavailable, "should have ondataavailable before onstop");
is(mMediaRecorder.state, 'inactive', 'check recording status is inactive');
SimpleTest.finish();
};
@ -53,8 +53,9 @@ function startTest(test, token) {
info('ondataavailable fired successfully');
if (mMediaRecorder.state == 'recording') {
hasondataavailable = true;
ok(hasonstart, "should has onstart event first");
ok(e.data.size > 0, 'check blob has data');
ok(hasonstart, "should have had start event first");
is(e.data.type, mMediaRecorder.mimeType,
"blob's mimeType matches the recorder's");
mMediaRecorder.stop();
}
};