зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1247138: [MSE] P2. Add mochitest. r=gerald
2nd media segment also exercise bug 1264622 resolution MozReview-Commit-ID: F5euopyUiPk --HG-- extra : rebase_source : b1e1199317612e159507583bcbc4753d106580a6
This commit is contained in:
Родитель
624abac6d4
Коммит
f18daf30b6
Двоичный файл не отображается.
|
@ -0,0 +1 @@
|
|||
Cache-Control: no-store
|
Двоичный файл не отображается.
|
@ -0,0 +1 @@
|
|||
Cache-Control: no-store
|
Двоичный файл не отображается.
|
@ -0,0 +1 @@
|
|||
Cache-Control: no-store
|
Двоичный файл не отображается.
|
@ -0,0 +1 @@
|
|||
Cache-Control: no-store
|
Двоичный файл не отображается.
|
@ -0,0 +1 @@
|
|||
Cache-Control: no-store
|
Двоичный файл не отображается.
|
@ -0,0 +1 @@
|
|||
Cache-Control: no-store
|
|
@ -34,7 +34,15 @@ support-files =
|
|||
bipbop/bipbop11.m4s^headers^ bipbop/bipbop_audio11.m4s^headers^ bipbop/bipbop_video11.m4s^headers^
|
||||
bipbop/bipbop12.m4s^headers^ bipbop/bipbop_video12.m4s^headers^
|
||||
bipbop/bipbop13.m4s^headers^ bipbop/bipbop_video13.m4s^headers^
|
||||
aac20-48000-64000-init.mp4 aac20-48000-64000-init.mp4^headers^
|
||||
aac20-48000-64000-1.m4s aac20-48000-64000-1.m4s^headers^
|
||||
aac20-48000-64000-2.m4s aac20-48000-64000-2.m4s^headers^
|
||||
aac51-48000-128000-init.mp4 aac51-48000-128000-init.mp4^headers^
|
||||
aac51-48000-128000-1.m4s aac51-48000-128000-1.m4s^headers^
|
||||
aac51-48000-128000-2.m4s aac51-48000-128000-2.m4s^headers^
|
||||
|
||||
[test_AudioChange_mp4.html]
|
||||
skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android')) # Not supported on xp and android 2.3
|
||||
[test_BufferedSeek.html]
|
||||
[test_BufferedSeek_mp4.html]
|
||||
skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android')) # Not supported on xp and android 2.3
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>MSE: basic functionality</title>
|
||||
<script type="text/javascript" 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>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// This test checks loading a stereo segment, followed by a 5.1 segment plays without error.
|
||||
|
||||
runWithMSE(function(ms, el) {
|
||||
el.controls = true;
|
||||
once(ms, 'sourceopen').then(function() {
|
||||
// Log events for debugging.
|
||||
var events = ["suspend", "play", "canplay", "canplaythrough", "loadstart", "loadedmetadata",
|
||||
"loadeddata", "playing", "ended", "error", "stalled", "emptied", "abort",
|
||||
"waiting", "pause", "durationchange", "seeking", "seeked"];
|
||||
function logEvent(e) {
|
||||
var v = e.target;
|
||||
info("got " + e.type + " event");
|
||||
}
|
||||
events.forEach(function(e) {
|
||||
el.addEventListener(e, logEvent, false);
|
||||
});
|
||||
|
||||
ok(true, "Receive a sourceopen event");
|
||||
var audiosb = ms.addSourceBuffer("audio/mp4");
|
||||
el.addEventListener("error", function(e) {
|
||||
ok(false, "should not fire '" + e.type + "' event");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
is(el.readyState, el.HAVE_NOTHING, "readyState is HAVE_NOTHING");
|
||||
fetchAndLoad(audiosb, 'aac20-48000-64000-', ['init'], '.mp4')
|
||||
.then(once.bind(null, el, 'loadedmetadata'))
|
||||
.then(function() {
|
||||
ok(true, "got loadedmetadata event");
|
||||
var promises = [];
|
||||
promises.push(once(el, 'loadeddata'));
|
||||
promises.push(once(el, 'canplay'));
|
||||
promises.push(fetchAndLoad(audiosb, 'aac20-48000-64000-', ['1'], '.m4s'));
|
||||
return Promise.all(promises);
|
||||
})
|
||||
.then(function() {
|
||||
ok(true, "got canplay event");
|
||||
el.play();
|
||||
return fetchAndLoad(audiosb, 'aac51-48000-128000-', ['init'], '.mp4');
|
||||
})
|
||||
.then(fetchAndLoad.bind(null, audiosb, 'aac51-48000-128000-', ['2'], '.m4s'))
|
||||
.then(function() {
|
||||
var promises = [];
|
||||
ms.endOfStream();
|
||||
promises.push(once(el, 'ended'));
|
||||
promises.push(once(audiosb, 'updateend'));
|
||||
return Promise.all(promises);
|
||||
})
|
||||
.then(function() {
|
||||
ok(el.currentTime >= 6, "played to the end");
|
||||
SimpleTest.finish();
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче