Bug 1684126 - part2 : add test. r=padenot

Differential Revision: https://phabricator.services.mozilla.com/D101408
This commit is contained in:
alwu 2021-01-12 18:48:39 +00:00
Родитель 80632b032f
Коммит 39938d7473
3 изменённых файлов: 34 добавлений и 0 удалений

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

@ -52,6 +52,7 @@ support-files =
init-trackid2.mp4 init-trackid3.mp4 segment-2.0001.m4s segment-2.0002.m4s segment-3.0001.m4s segment-3.0002.m4s
init-trackid2.mp4^headers^ init-trackid3.mp4^headers^ segment-2.0001.m4s^headers^ segment-2.0002.m4s^headers^
segment-3.0001.m4s^headers^ segment-3.0002.m4s^headers^
wmf_mismatchedaudiotime.mp4
[test_AbortAfterPartialMediaSegment.html]
[test_AppendPartialInitSegment.html]
@ -158,3 +159,4 @@ skip-if = toolkit == 'android' # Not supported on android
[test_WaitingToEndedTransition_mp4.html]
skip-if = (toolkit == 'android') || (os == 'linux') # Not supported on android, Bug 1495167
[test_WebMTagsBeforeCluster.html]
[test_WMFUnmatchedAudioDataTime.html]

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

@ -0,0 +1,32 @@
<!DOCTYPE HTML>
<html>
<head>
<title>MSE: audio output time doesn't match the input time on WMF</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="mediasource.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
runWithMSE(async (ms, v) => {
await once(ms, "sourceopen");
const sb = ms.addSourceBuffer('audio/mp4;codecs=" mp4a.40.2"');
sb.appendBuffer(new Uint8Array(await fetchWithXHR("wmf_mismatchedaudiotime.mp4")));
ok(true, "appended data");
info(`if error doesn't occur, we should be able to receive 'seeked', otherwise 'error' would be dispatched`);
v.currentTime = 22.05;
ok(await Promise.race([
once(v, "seeked").then(_ => true),
once(v, "error").then(_ => false),
]), "finished seeking without any error");
ok(!v.error, "should not get any error");
SimpleTest.finish();
});
</script>
</body>
</html>

Двоичные данные
dom/media/mediasource/test/wmf_mismatchedaudiotime.mp4 Normal file

Двоичный файл не отображается.