Bug 1362165: P3. Remove unecessary code. r=gerald

We have no need to call endOfStream here as we don't rely on the ended event being fired.
Also, there's no need to track how many update count we will get when we only use appendBuffer once.

Adding extra test to help identify where the actual failure of the test could occur.

MozReview-Commit-ID: HIu1XQpHark

--HG--
extra : rebase_source : 07f9ac856d290f1347ec4b33794dc7d20adcc4cc
This commit is contained in:
Jean-Yves Avenard 2017-04-28 16:18:36 +02:00
Родитель 5dd9cac21c
Коммит 3b95392a3c
2 изменённых файлов: 2 добавлений и 22 удалений

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

@ -12,28 +12,18 @@
SimpleTest.waitForExplicitFinish();
var updateCount = 0;
runWithMSE(function (ms, v) {
ms.addEventListener("sourceopen", function () {
var sb = ms.addSourceBuffer("video/webm");
fetchWithXHR("seek.webm", function (arrayBuffer) {
sb.appendBuffer(new Uint8Array(arrayBuffer));
sb.addEventListener("updateend", function () {
updateCount++;
/* Ensure that we endOfStream on the first update event only as endOfStream can
raise more if the duration of the last buffered range and the intial duration
differ. See bug 1065207 */
if (updateCount == 1) {
ms.endOfStream();
};
});
});
var target = 2;
v.addEventListener("loadedmetadata", function () {
ok(true, "received loadedmetadata");
v.currentTime = target;
});

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

@ -12,28 +12,18 @@
SimpleTest.waitForExplicitFinish();
var updateCount = 0;
runWithMSE(function (ms, v) {
ms.addEventListener("sourceopen", function () {
var sb = ms.addSourceBuffer("video/mp4");
fetchWithXHR("bipbop/bipbop2s.mp4", function (arrayBuffer) {
sb.appendBuffer(new Uint8Array(arrayBuffer));
sb.addEventListener("updateend", function () {
updateCount++;
/* Ensure that we endOfStream on the first update event only as endOfStream can
raise more if the duration of the last buffered range and the intial duration
differ. See bug 1065207 */
if (updateCount == 1) {
ms.endOfStream();
};
});
});
var target = 1.3;
v.addEventListener("loadedmetadata", function () {
ok(true, "received loadedmetadata");
v.currentTime = target;
});