Bug 488287. When playback ends, readyState should change to HAVE_CURRENT_DATA. r=doublec,sr=roc

--HG--
extra : rebase_source : ea224af1634304c40d7e4ea0f564e72ccab65caa
This commit is contained in:
Matthew Gregan 2009-05-08 14:25:13 +12:00
Родитель fa85bd42db
Коммит 1bc6593cf3
5 изменённых файлов: 9 добавлений и 4 удалений

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

@ -1205,6 +1205,7 @@ void nsHTMLMediaElement::NetworkError()
void nsHTMLMediaElement::PlaybackEnded()
{
NS_ASSERTION(mDecoder->IsEnded(), "Decoder fired ended, but not in ended state");
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA);
DispatchAsyncSimpleEvent(NS_LITERAL_STRING("ended"));
}

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

@ -43,8 +43,9 @@ function playbackEnded() {
ok(v.currentTime >= 3.9 && v.currentTime <= 4.0,
"Checking currentTime at end: " + v.currentTime);
ok(v.ended, "Checking playback has ended");
ok(playingCount > 0, "Expect at least one playing event");
playingCount = 0;
if (endCount < 2) {
ok(playingCount > 0, "Expect at least one playing event");
v.currentTime = 0;
ok(v.seeking, "Checking that seeking is now true");
ok(!v.ended, "Checking ended is no longer set as seeking has begun");

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

@ -43,8 +43,9 @@ function playbackEnded() {
ok(v.currentTime >= 0.9 && v.currentTime <= 1.1,
"Checking currentTime at end: " + v.currentTime);
ok(v.ended, "Checking playback has ended");
ok(playingCount > 0, "Expect at least one playing event");
playingCount = 0;
if (endCount < 2) {
ok(playingCount > 0, "Expect at least one playing event");
v.currentTime = 0;
ok(v.seeking, "Checking that seeking is now true");
ok(!v.ended, "Checking ended is no longer set as seeking has begun");

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

@ -39,8 +39,9 @@ function playbackEnded() {
ok(v.currentTime >= 3.9 && v.currentTime <= 4.0,
"Checking currentTime at end: " + v.currentTime);
ok(v.ended, "Checking playback has ended");
ok(playingCount > 0, "Expect at least one playing event");
playingCount = 0;
if (endCount < 2) {
ok(playingCount > 0, "Expect at least one playing event");
v.play();
} else {
ok(endCount == 2, "Check playback after ended event");

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

@ -40,8 +40,9 @@ function playbackEnded() {
ok(v.currentTime >= 0.9 && v.currentTime <= 1.1,
"Checking currentTime at end: " + v.currentTime);
ok(v.ended, "Checking playback has ended");
ok(playingCount > 0, "Expect at least one playing event");
playingCount = 0;
if (endCount < 2) {
ok(playingCount > 0, "Expect at least one playing event");
v.play();
} else {
ok(endCount == 2, "Check playback after ended event");