Bug 1293613: don't assume playback won't be finished by the time the seeked event is fired. r=gerald

The data added in the sourcebuffer is very short (less than one second); it is possible that playback has completed prior the event being fired.

MozReview-Commit-ID: INHAFmEhSut

--HG--
extra : rebase_source : 864c2a9623d672859b0ab836e25403e90ee2090c
This commit is contained in:
Jean-Yves Avenard 2016-08-10 22:11:43 +10:00
Родитель dc44fe89f0
Коммит 5dd7436747
1 изменённых файлов: 20 добавлений и 2 удалений

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

@ -73,7 +73,16 @@
test.waitForExpectedEvents(function()
{
assert_greater_than(mediaElement.readyState, mediaElement.HAVE_CURRENT_DATA, 'Greater than HAVE_CURRENT_DATA');
// Note: we just completed the seek. However, we only have less than a second worth of data to play. It is possible that
// playback has reached the end since the seek completed.
if (!mediaElement.paused)
{
assert_greater_than_equal(mediaElement.readyState, mediaElement.HAVE_CURRENT_DATA, 'Greater or equal than HAVE_CURRENT_DATA');
}
else
{
assert_true(mediaElement.ended);
}
test.done();
});
@ -161,7 +170,16 @@
test.waitForExpectedEvents(function()
{
assert_greater_than(mediaElement.readyState, mediaElement.HAVE_CURRENT_DATA, 'Greater than HAVE_CURRENT_DATA');
// Note: we just completed the seek. However, we only have less than a second worth of data to play. It is possible that
// playback has reached the end since the seek completed.
if (!mediaElement.paused)
{
assert_greater_than_equal(mediaElement.readyState, mediaElement.HAVE_CURRENT_DATA, 'Greater or equal than HAVE_CURRENT_DATA');
}
else
{
assert_true(mediaElement.ended);
}
test.done();
});
}, 'Test seeking to a new location during a pending seek.');