Title: [159810] trunk
Revision
159810
Author
calva...@igalia.com
Date
2013-11-27 02:47:56 -0800 (Wed, 27 Nov 2013)

Log Message

[GStreamer] Invalid command line error when visiting www.chessbase.com
https://bugs.webkit.org/show_bug.cgi?id=124715

Reviewed by Philippe Normand.

Source/WebCore:

We were not handling the HTTP errors in the WebKit GStreamer
source and therefore the 404 error page was being 'decoded'. As no
decoder could be found (for obvious reasons), playback failed, but
it should be failing for the source not being found instead of the
decoding problem.

Test: http/tests/media/video-error-does-not-exist.html

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(StreamingClient::handleResponseReceived): Handle HTTP errors in
the source and raise a GStreamer error to the pipeline.

LayoutTests:

Copied and adapted for HTTP from
media/video-error-does-not-exist.html.

* http/tests/media/video-error-does-not-exist-expected.txt: Added.
* http/tests/media/video-error-does-not-exist.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (159809 => 159810)


--- trunk/LayoutTests/ChangeLog	2013-11-27 08:43:07 UTC (rev 159809)
+++ trunk/LayoutTests/ChangeLog	2013-11-27 10:47:56 UTC (rev 159810)
@@ -1,3 +1,16 @@
+2013-11-27  Xabier Rodriguez Calvar  <calva...@igalia.com>
+
+        [GStreamer] Invalid command line error when visiting www.chessbase.com
+        https://bugs.webkit.org/show_bug.cgi?id=124715
+
+        Reviewed by Philippe Normand.
+
+        Copied and adapted for HTTP from
+        media/video-error-does-not-exist.html.
+
+        * http/tests/media/video-error-does-not-exist-expected.txt: Added.
+        * http/tests/media/video-error-does-not-exist.html: Added.
+
 2013-11-14  Sergio Villar Senin  <svil...@igalia.com>
 
         [CSS Grid Layout] Fix positioning of grid items with margins

Added: trunk/LayoutTests/http/tests/media/video-error-does-not-exist-expected.txt (0 => 159810)


--- trunk/LayoutTests/http/tests/media/video-error-does-not-exist-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/media/video-error-does-not-exist-expected.txt	2013-11-27 10:47:56 UTC (rev 159810)
@@ -0,0 +1,17 @@
+Test that the media element is in correct state after load fails from HTTP.
+
+
+
+EXPECTED (video.error == 'null') OK
+
+EVENT(error)
+EXPECTED (video.error != 'null') OK
+EXPECTED (video.error.code == '4') OK
+EXPECTED (video.networkState == '3') OK
+EXPECTED (isNaN(video.duration) == 'true') OK
+EXPECTED (video.currentTime == '0') OK
+EXPECTED (video.buffered.length == '0') OK
+EXPECTED (video.seekable.length == '0') OK
+EXPECTED (video.buffered.length == '0') OK
+END OF TEST
+

Added: trunk/LayoutTests/http/tests/media/video-error-does-not-exist.html (0 => 159810)


--- trunk/LayoutTests/http/tests/media/video-error-does-not-exist.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/media/video-error-does-not-exist.html	2013-11-27 10:47:56 UTC (rev 159810)
@@ -0,0 +1,28 @@
+<p>Test that the media element is in correct state after load fails from HTTP.</p>
+<video controls></video>
+<script src=""
+<script src=""
+<script>
+
+    consoleWrite("");
+    testExpected("video.error", null);
+
+    waitForEventAndTest("canplaythrough", "false");
+    
+    waitForEvent("error", function () {
+        testExpected("video.error", null, "!=");
+        testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
+    
+        testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE);
+    
+        testExpected("isNaN(video.duration)", true);
+        testExpected("video.currentTime", 0);
+        testExpected("video.buffered.length", 0);
+        testExpected("video.seekable.length", 0);
+        testExpected("video.buffered.length", 0);
+        endTest();
+    });
+    
+    video.src = ""
+    consoleWrite("");
+</script>

Modified: trunk/Source/WebCore/ChangeLog (159809 => 159810)


--- trunk/Source/WebCore/ChangeLog	2013-11-27 08:43:07 UTC (rev 159809)
+++ trunk/Source/WebCore/ChangeLog	2013-11-27 10:47:56 UTC (rev 159810)
@@ -1,3 +1,22 @@
+2013-11-27  Xabier Rodriguez Calvar  <calva...@igalia.com>
+
+        [GStreamer] Invalid command line error when visiting www.chessbase.com
+        https://bugs.webkit.org/show_bug.cgi?id=124715
+
+        Reviewed by Philippe Normand.
+
+        We were not handling the HTTP errors in the WebKit GStreamer
+        source and therefore the 404 error page was being 'decoded'. As no
+        decoder could be found (for obvious reasons), playback failed, but
+        it should be failing for the source not being found instead of the
+        decoding problem.
+
+        Test: http/tests/media/video-error-does-not-exist.html
+
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (StreamingClient::handleResponseReceived): Handle HTTP errors in
+        the source and raise a GStreamer error to the pipeline.
+
 2013-11-14  Sergio Villar Senin  <svil...@igalia.com>
 
         [CSS Grid Layout] Fix positioning of grid items with margins

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp (159809 => 159810)


--- trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2013-11-27 08:43:07 UTC (rev 159809)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2013-11-27 10:47:56 UTC (rev 159810)
@@ -837,6 +837,14 @@
 
     GST_DEBUG_OBJECT(src, "Received response: %d", response.httpStatusCode());
 
+    if (response.httpStatusCode() >= 400) {
+        // Received error code
+        GST_ELEMENT_ERROR(src, RESOURCE, READ, ("Received %d HTTP error code", response.httpStatusCode()), (0));
+        gst_app_src_end_of_stream(priv->appsrc);
+        webKitWebSrcStop(src);
+        return;
+    }
+
     GMutexLocker locker(GST_OBJECT_GET_LOCK(src));
 
     if (priv->seekID) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to