2009-03-24 Eric Carlson <eric.carlson@apple.com>
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Mar 2009 17:36:29 +0000 (17:36 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Mar 2009 17:36:29 +0000 (17:36 +0000)
        Update media tests broken by r41907.

        * fast/dom/Window/window-properties-expected.txt:
        * http/tests/media/video-play-stall-seek.html:
        * http/tests/media/video-play-stall.html:

2009-03-24  Eric Carlson  <eric.carlson@apple.com>

        Fix layout tests broken by r41907.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::setReadyState): Don't set "was playing" based on the new ready state

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41942 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/window-properties-expected.txt
LayoutTests/http/tests/media/video-play-stall-expected.txt
LayoutTests/http/tests/media/video-play-stall-seek-expected.txt
LayoutTests/http/tests/media/video-play-stall-seek.html
LayoutTests/http/tests/media/video-play-stall.html
LayoutTests/platform/mac-leopard/fast/dom/Window/window-properties-expected.txt
WebCore/ChangeLog
WebCore/html/HTMLMediaElement.cpp

index a53eb77..5db128a 100644 (file)
@@ -1,3 +1,11 @@
+2009-03-24  Eric Carlson  <eric.carlson@apple.com>
+
+        Update media tests broken by r41907.
+
+        * fast/dom/Window/window-properties-expected.txt:
+        * http/tests/media/video-play-stall-seek.html:
+        * http/tests/media/video-play-stall.html:
+
 2009-03-24  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Darin Adler.
index 1d893f4..4eceb9e 100644 (file)
@@ -42,12 +42,8 @@ window.Attr.prototype.replaceChild [function]
 window.Audio [object AudioConstructor]
 window.Audio.prototype [object HTMLAudioElementPrototype]
 window.Audio.prototype.ATTRIBUTE_NODE [number]
-window.Audio.prototype.CAN_PLAY [number]
-window.Audio.prototype.CAN_PLAY_THROUGH [number]
-window.Audio.prototype.CAN_SHOW_CURRENT_FRAME [number]
 window.Audio.prototype.CDATA_SECTION_NODE [number]
 window.Audio.prototype.COMMENT_NODE [number]
-window.Audio.prototype.DATA_UNAVAILABLE [number]
 window.Audio.prototype.DOCUMENT_FRAGMENT_NODE [number]
 window.Audio.prototype.DOCUMENT_NODE [number]
 window.Audio.prototype.DOCUMENT_POSITION_CONTAINED_BY [number]
@@ -58,13 +54,18 @@ window.Audio.prototype.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC [number]
 window.Audio.prototype.DOCUMENT_POSITION_PRECEDING [number]
 window.Audio.prototype.DOCUMENT_TYPE_NODE [number]
 window.Audio.prototype.ELEMENT_NODE [number]
-window.Audio.prototype.EMPTY [number]
 window.Audio.prototype.ENTITY_NODE [number]
 window.Audio.prototype.ENTITY_REFERENCE_NODE [number]
-window.Audio.prototype.LOADED [number]
-window.Audio.prototype.LOADED_FIRST_FRAME [number]
-window.Audio.prototype.LOADED_METADATA [number]
-window.Audio.prototype.LOADING [number]
+window.Audio.prototype.HAVE_CURRENT_DATA [number]
+window.Audio.prototype.HAVE_ENOUGH_DATA [number]
+window.Audio.prototype.HAVE_FUTURE_DATA [number]
+window.Audio.prototype.HAVE_METADATA [number]
+window.Audio.prototype.HAVE_NOTHING [number]
+window.Audio.prototype.NETWORK_EMPTY [number]
+window.Audio.prototype.NETWORK_IDLE [number]
+window.Audio.prototype.NETWORK_LOADED [number]
+window.Audio.prototype.NETWORK_LOADING [number]
+window.Audio.prototype.NETWORK_NO_SOURCE [number]
 window.Audio.prototype.NOTATION_NODE [number]
 window.Audio.prototype.PROCESSING_INSTRUCTION_NODE [number]
 window.Audio.prototype.TEXT_NODE [number]
@@ -933,15 +934,16 @@ window.HTMLMapElement.prototype [printed above as window.Element.prototype]
 window.HTMLMarqueeElement [object HTMLMarqueeElementConstructor]
 window.HTMLMarqueeElement.prototype [printed above as window.Element.prototype]
 window.HTMLMediaElement [object HTMLMediaElementConstructor]
-window.HTMLMediaElement.CAN_PLAY [number]
-window.HTMLMediaElement.CAN_PLAY_THROUGH [number]
-window.HTMLMediaElement.CAN_SHOW_CURRENT_FRAME [number]
-window.HTMLMediaElement.DATA_UNAVAILABLE [number]
-window.HTMLMediaElement.EMPTY [number]
-window.HTMLMediaElement.LOADED [number]
-window.HTMLMediaElement.LOADED_FIRST_FRAME [number]
-window.HTMLMediaElement.LOADED_METADATA [number]
-window.HTMLMediaElement.LOADING [number]
+window.HTMLMediaElement.HAVE_CURRENT_DATA [number]
+window.HTMLMediaElement.HAVE_ENOUGH_DATA [number]
+window.HTMLMediaElement.HAVE_FUTURE_DATA [number]
+window.HTMLMediaElement.HAVE_METADATA [number]
+window.HTMLMediaElement.HAVE_NOTHING [number]
+window.HTMLMediaElement.NETWORK_EMPTY [number]
+window.HTMLMediaElement.NETWORK_IDLE [number]
+window.HTMLMediaElement.NETWORK_LOADED [number]
+window.HTMLMediaElement.NETWORK_LOADING [number]
+window.HTMLMediaElement.NETWORK_NO_SOURCE [number]
 window.HTMLMediaElement.prototype [printed above as window.Element.prototype]
 window.HTMLMenuElement [object HTMLMenuElementConstructor]
 window.HTMLMenuElement.prototype [printed above as window.Element.prototype]
@@ -999,10 +1001,12 @@ window.MediaError [object MediaErrorConstructor]
 window.MediaError.MEDIA_ERR_ABORTED [number]
 window.MediaError.MEDIA_ERR_DECODE [number]
 window.MediaError.MEDIA_ERR_NETWORK [number]
+window.MediaError.MEDIA_ERR_NONE_SUPPORTED [number]
 window.MediaError.prototype [object MediaErrorPrototype]
 window.MediaError.prototype.MEDIA_ERR_ABORTED [number]
 window.MediaError.prototype.MEDIA_ERR_DECODE [number]
 window.MediaError.prototype.MEDIA_ERR_NETWORK [number]
+window.MediaError.prototype.MEDIA_ERR_NONE_SUPPORTED [number]
 window.MediaList [object MediaListConstructor]
 window.MediaList.prototype [object MediaListPrototype]
 window.MediaList.prototype.appendMedium [function]
index 7ddb9cb..6615164 100644 (file)
@@ -1,12 +1,12 @@
-Test that dataunavailable, timeupdate and waiting events are sent when media load stalls in the middle.
+Test that stalled, timeupdate and waiting events are sent when media load stalls in the middle.
 
+RUN(video.play())
 EVENT(durationchange)
 EVENT(loadedmetadata)
-EVENT(loadedfirstframe)
-EVENT(canshowcurrentframe)
+EVENT(loadeddata)
 EVENT(canplay)
-EVENT(dataunavailable)
 EVENT(timeupdate)
 EVENT(waiting)
+EVENT(stalled)
 END OF TEST
 
index ead1e3e..b7c8225 100644 (file)
@@ -1,10 +1,11 @@
 Test that playback can be resumed by seeking backwards after load stalls.
 
+RUN(video.play())
 EVENT(waiting)
-TEST(video.readyState == HTMLMediaElement.DATA_UNAVAILABLE) OK
-RUN(video.currentTime = 0.5)
+EXPECTED (video.readyState == '2') OK
+RUN(video.currentTime = 0.1)
 EVENT(canplay)
-TEST(video.readyState == HTMLMediaElement.CAN_PLAY) OK
-TEST(video.networkState == HTMLMediaElement.LOADED_FIRST_FRAME) OK
+EXPECTED (video.readyState >= '2') OK
+EXPECTED (video.networkState == '2') OK
 END OF TEST
 
index 1464881..76d1e01 100644 (file)
@@ -1,16 +1,22 @@
-<video></video>
+<video controls></video>
 <p>Test that playback can be resumed by seeking backwards after load stalls.</p>
 <script src=../../../media/video-test.js></script>
 <script>
-waitForEvent('waiting', function () {
-    waitForEvent('canplay' , function () {
-        test("video.readyState == HTMLMediaElement.CAN_PLAY");
-        test("video.networkState == HTMLMediaElement.LOADED_FIRST_FRAME");
-        endTest();
+
+    waitForEvent('waiting', function () {
+
+        // now that playback has paused to wait for data, seek back and verify that we
+        // get a 'canplay' event
+        waitForEvent('canplay' , function () {
+            testExpected("video.readyState", HTMLMediaElement.HAVE_CURRENT_DATA, ">=");
+            testExpected("video.networkState", HTMLMediaElement.NETWORK_LOADING);
+            endTest();
+        } );
+        testExpected("video.readyState", HTMLMediaElement.HAVE_CURRENT_DATA);
+        
+        run("video.currentTime = 0.1");
     } );
-    test("video.readyState == HTMLMediaElement.DATA_UNAVAILABLE");
-    run("video.currentTime = 0.5");
-} );
-video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/content/test.mp4&stallAt=100000";
-video.play();
+
+    video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/content/test.mp4&stallAt=100000";
+    run("video.play()");
 </script>
index 0140669..4136f96 100644 (file)
@@ -1,16 +1,30 @@
 <video></video>
-<p>Test that dataunavailable, timeupdate and waiting events are sent when media load stalls in the middle.</p>
+<p>Test that stalled, timeupdate and waiting events are sent when media load stalls in the middle.</p>
 <script src=../../../media/video-test.js></script>
 <script>
-waitForEvent('durationchange');
-waitForEvent('loadedmetadata');
-waitForEvent('loadedfirstframe');
-waitForEvent('canshowcurrentframe');
-waitForEvent('canplay', function () {
-    waitForEvent('dataunavailable');
-    waitForEvent('timeupdate');
-    waitForEventAndEnd('waiting');
-} );
-video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/content/test.mp4&stallAt=100000";
-video.play();
+
+    var timeupdateCount = 0;
+
+    waitForEvent('durationchange');
+    waitForEvent('loadedmetadata');
+    waitForEvent('loadeddata');
+    waitForEvent('canplaythrough');
+    waitForEvent('canplay', function () {
+
+        media.addEventListener('timeupdate', function () {
+            // timeupdate events are fired as playback progresses so only verify that at least one
+            // event is fired
+            ++timeupdateCount;
+            if (timeupdateCount == 1)
+                consoleWrite("EVENT(timeupdate)");
+        } );
+
+        waitForEvent('waiting', function () {
+            waitForEventAndEnd('timeupdate');
+        } );
+
+        waitForEventAndEnd('stalled');
+    } );
+    video.src = "http://127.0.0.1:8000/media/video-load-and-stall.cgi?name=../../../media/content/test.mp4&stallAt=100000";
+    run("video.play()");
 </script>
index 3ac4ec4..6ec4a5b 100644 (file)
@@ -42,12 +42,8 @@ window.Attr.prototype.replaceChild [function]
 window.Audio [object AudioConstructor]
 window.Audio.prototype [object HTMLAudioElementPrototype]
 window.Audio.prototype.ATTRIBUTE_NODE [number]
-window.Audio.prototype.CAN_PLAY [number]
-window.Audio.prototype.CAN_PLAY_THROUGH [number]
-window.Audio.prototype.CAN_SHOW_CURRENT_FRAME [number]
 window.Audio.prototype.CDATA_SECTION_NODE [number]
 window.Audio.prototype.COMMENT_NODE [number]
-window.Audio.prototype.DATA_UNAVAILABLE [number]
 window.Audio.prototype.DOCUMENT_FRAGMENT_NODE [number]
 window.Audio.prototype.DOCUMENT_NODE [number]
 window.Audio.prototype.DOCUMENT_POSITION_CONTAINED_BY [number]
@@ -58,13 +54,18 @@ window.Audio.prototype.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC [number]
 window.Audio.prototype.DOCUMENT_POSITION_PRECEDING [number]
 window.Audio.prototype.DOCUMENT_TYPE_NODE [number]
 window.Audio.prototype.ELEMENT_NODE [number]
-window.Audio.prototype.EMPTY [number]
 window.Audio.prototype.ENTITY_NODE [number]
 window.Audio.prototype.ENTITY_REFERENCE_NODE [number]
-window.Audio.prototype.LOADED [number]
-window.Audio.prototype.LOADED_FIRST_FRAME [number]
-window.Audio.prototype.LOADED_METADATA [number]
-window.Audio.prototype.LOADING [number]
+window.Audio.prototype.HAVE_CURRENT_DATA [number]
+window.Audio.prototype.HAVE_ENOUGH_DATA [number]
+window.Audio.prototype.HAVE_FUTURE_DATA [number]
+window.Audio.prototype.HAVE_METADATA [number]
+window.Audio.prototype.HAVE_NOTHING [number]
+window.Audio.prototype.NETWORK_EMPTY [number]
+window.Audio.prototype.NETWORK_IDLE [number]
+window.Audio.prototype.NETWORK_LOADED [number]
+window.Audio.prototype.NETWORK_LOADING [number]
+window.Audio.prototype.NETWORK_NO_SOURCE [number]
 window.Audio.prototype.NOTATION_NODE [number]
 window.Audio.prototype.PROCESSING_INSTRUCTION_NODE [number]
 window.Audio.prototype.TEXT_NODE [number]
@@ -933,15 +934,16 @@ window.HTMLMapElement.prototype [printed above as window.Element.prototype]
 window.HTMLMarqueeElement [object HTMLMarqueeElementConstructor]
 window.HTMLMarqueeElement.prototype [printed above as window.Element.prototype]
 window.HTMLMediaElement [object HTMLMediaElementConstructor]
-window.HTMLMediaElement.CAN_PLAY [number]
-window.HTMLMediaElement.CAN_PLAY_THROUGH [number]
-window.HTMLMediaElement.CAN_SHOW_CURRENT_FRAME [number]
-window.HTMLMediaElement.DATA_UNAVAILABLE [number]
-window.HTMLMediaElement.EMPTY [number]
-window.HTMLMediaElement.LOADED [number]
-window.HTMLMediaElement.LOADED_FIRST_FRAME [number]
-window.HTMLMediaElement.LOADED_METADATA [number]
-window.HTMLMediaElement.LOADING [number]
+window.HTMLMediaElement.HAVE_CURRENT_DATA [number]
+window.HTMLMediaElement.HAVE_ENOUGH_DATA [number]
+window.HTMLMediaElement.HAVE_FUTURE_DATA [number]
+window.HTMLMediaElement.HAVE_METADATA [number]
+window.HTMLMediaElement.HAVE_NOTHING [number]
+window.HTMLMediaElement.NETWORK_EMPTY [number]
+window.HTMLMediaElement.NETWORK_IDLE [number]
+window.HTMLMediaElement.NETWORK_LOADED [number]
+window.HTMLMediaElement.NETWORK_LOADING [number]
+window.HTMLMediaElement.NETWORK_NO_SOURCE [number]
 window.HTMLMediaElement.prototype [printed above as window.Element.prototype]
 window.HTMLMenuElement [object HTMLMenuElementConstructor]
 window.HTMLMenuElement.prototype [printed above as window.Element.prototype]
@@ -999,10 +1001,12 @@ window.MediaError [object MediaErrorConstructor]
 window.MediaError.MEDIA_ERR_ABORTED [number]
 window.MediaError.MEDIA_ERR_DECODE [number]
 window.MediaError.MEDIA_ERR_NETWORK [number]
+window.MediaError.MEDIA_ERR_NONE_SUPPORTED [number]
 window.MediaError.prototype [object MediaErrorPrototype]
 window.MediaError.prototype.MEDIA_ERR_ABORTED [number]
 window.MediaError.prototype.MEDIA_ERR_DECODE [number]
 window.MediaError.prototype.MEDIA_ERR_NETWORK [number]
+window.MediaError.prototype.MEDIA_ERR_NONE_SUPPORTED [number]
 window.MediaList [object MediaListConstructor]
 window.MediaList.prototype [object MediaListPrototype]
 window.MediaList.prototype.appendMedium [function]
index 9569f09..bfab650 100644 (file)
@@ -1,3 +1,10 @@
+2009-03-24  Eric Carlson  <eric.carlson@apple.com>
+
+        Fix layout tests broken by r41907.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::setReadyState): Don't set "was playing" based on the new ready state
+
 2009-03-24  Dmitry Titov  <dimich@chromium.org>
 
         Reviewed by Dimitri Glazkov.
index da2271c..fd1751f 100644 (file)
@@ -625,6 +625,9 @@ void HTMLMediaElement::mediaPlayerReadyStateChanged(MediaPlayer*)
 
 void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
 {
+    // Set "wasPotentiallyPlaying" BEFORE updating m_readyState, potentiallyPlaying() uses it
+    bool wasPotentiallyPlaying = potentiallyPlaying();
+
     ReadyState oldState = m_readyState;
     m_readyState = static_cast<ReadyState>(state);
 
@@ -643,7 +646,6 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
         m_seeking = false;
     }
 
-    bool wasPotentiallyPlaying = potentiallyPlaying();
     if (wasPotentiallyPlaying && m_readyState < HAVE_FUTURE_DATA) {
         // 4.8.10.9
         scheduleTimeupdateEvent(false);