Title: [282205] trunk/LayoutTests
Revision
282205
Author
[email protected]
Date
2021-09-09 03:02:34 -0700 (Thu, 09 Sep 2021)

Log Message

[Gstreamer] timeouts in media/media-source/media-source-has-audio-video.html and media/media-source/media-source-seek-unbuffered.html
https://bugs.webkit.org/show_bug.cgi?id=227258
<rdar://problem/79625722>

Reviewed by Alicia Boya Garcia.

The media-source-seek-unbuffered.html test was feeding only one segment
(1 second) to the SourceBuffer, but the libav h264 decoder used by the
glib ports needs more data to start producing decoded output.
The test was modified to append two segments (2 seconds) instead and now
the test passes.

The concatArrayBuffers() function from the media-source-error-crash.html
test was refactored as MediaSourceLoader.concatenateMediaSegments() and
reused in media-source-seek-unbuffered.html.

* media/media-source/media-source-error-crash-expected.txt: Expect different concatenation _expression_.
* media/media-source/media-source-error-crash.html: Removed concatArrayBuffers() and use MediaSourceLoader.concatenateMediaSegments() instead.
* media/media-source/media-source-loader.js:
(MediaSourceLoader.prototype.concatenateMediaSegments): New method that concatenates two media segments (ArrayBuffers).
* media/media-source/media-source-seek-unbuffered-expected.txt: Modified expectations to expect a different removed range and a more legible currentTime check.
* media/media-source/media-source-seek-unbuffered.html: Append 2 segments, remove [0.5, 2] instead of [0.5, 1] and improve legibility of currentTime check.
* platform/glib/TestExpectations: Unskipped test.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (282204 => 282205)


--- trunk/LayoutTests/ChangeLog	2021-09-09 09:38:41 UTC (rev 282204)
+++ trunk/LayoutTests/ChangeLog	2021-09-09 10:02:34 UTC (rev 282205)
@@ -1,3 +1,29 @@
+2021-09-09  Enrique Ocaña González  <[email protected]>
+
+        [Gstreamer] timeouts in media/media-source/media-source-has-audio-video.html and media/media-source/media-source-seek-unbuffered.html
+        https://bugs.webkit.org/show_bug.cgi?id=227258
+        <rdar://problem/79625722>
+
+        Reviewed by Alicia Boya Garcia.
+
+        The media-source-seek-unbuffered.html test was feeding only one segment
+        (1 second) to the SourceBuffer, but the libav h264 decoder used by the
+        glib ports needs more data to start producing decoded output.
+        The test was modified to append two segments (2 seconds) instead and now
+        the test passes.
+
+        The concatArrayBuffers() function from the media-source-error-crash.html
+        test was refactored as MediaSourceLoader.concatenateMediaSegments() and
+        reused in media-source-seek-unbuffered.html.
+
+        * media/media-source/media-source-error-crash-expected.txt: Expect different concatenation _expression_.
+        * media/media-source/media-source-error-crash.html: Removed concatArrayBuffers() and use MediaSourceLoader.concatenateMediaSegments() instead.
+        * media/media-source/media-source-loader.js:
+        (MediaSourceLoader.prototype.concatenateMediaSegments): New method that concatenates two media segments (ArrayBuffers).
+        * media/media-source/media-source-seek-unbuffered-expected.txt: Modified expectations to expect a different removed range and a more legible currentTime check.
+        * media/media-source/media-source-seek-unbuffered.html: Append 2 segments, remove [0.5, 2] instead of [0.5, 1] and improve legibility of currentTime check.
+        * platform/glib/TestExpectations: Unskipped test.
+
 2021-09-09  Cameron McCormack  <[email protected]>
 
         Update WPT tests under /html/canvas/element

Modified: trunk/LayoutTests/media/media-source/media-source-error-crash-expected.txt (282204 => 282205)


--- trunk/LayoutTests/media/media-source/media-source-error-crash-expected.txt	2021-09-09 09:38:41 UTC (rev 282204)
+++ trunk/LayoutTests/media/media-source/media-source-error-crash-expected.txt	2021-09-09 10:02:34 UTC (rev 282205)
@@ -5,7 +5,7 @@
 RUN(sourceBuffer = source.addSourceBuffer(loader.type()))
 RUN(sourceBuffer2 = source.addSourceBuffer(loader.type()))
 Append an invalid media segment; should not crash.
-RUN(sourceBuffer.appendBuffer(concatArrayBuffers(loader.initSegment(), new ArrayBuffer(512))))
+RUN(sourceBuffer.appendBuffer(loader.concatenateMediaSegments([loader.initSegment(), new ArrayBuffer(512)])))
 EVENT(error)
 END OF TEST
 

Modified: trunk/LayoutTests/media/media-source/media-source-error-crash.html (282204 => 282205)


--- trunk/LayoutTests/media/media-source/media-source-error-crash.html	2021-09-09 09:38:41 UTC (rev 282204)
+++ trunk/LayoutTests/media/media-source/media-source-error-crash.html	2021-09-09 10:02:34 UTC (rev 282205)
@@ -10,13 +10,6 @@
     var sourceBuffer;
     var sourceBuffer2;
 
-    function concatArrayBuffers(buffer1, buffer2) {
-    	var view = new Uint8Array(buffer1.byteLength + buffer2.byteLength);
-    	view.set(new Uint8Array(buffer1), 0);
-    	view.set(new Uint8Array(buffer2), buffer1.byteLength);
-    	return view.buffer;
-    }
-
     function runTest() {
         findMediaElement();
 
@@ -41,7 +34,7 @@
         run('sourceBuffer2 = source.addSourceBuffer(loader.type())');
         waitForEventAndEnd('error');
         consoleWrite('Append an invalid media segment; should not crash.')
-        run('sourceBuffer.appendBuffer(concatArrayBuffers(loader.initSegment(), new ArrayBuffer(512)))');
+        run('sourceBuffer.appendBuffer(loader.concatenateMediaSegments([loader.initSegment(), new ArrayBuffer(512)]))');
     }
 
     </script>
@@ -49,4 +42,4 @@
 <body _onload_="runTest()">
     <video controls></video>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/media/media-source/media-source-loader.js (282204 => 282205)


--- trunk/LayoutTests/media/media-source/media-source-loader.js	2021-09-09 09:38:41 UTC (rev 282204)
+++ trunk/LayoutTests/media/media-source/media-source-loader.js	2021-09-09 10:02:34 UTC (rev 282205)
@@ -95,4 +95,17 @@
         var media = this._manifest.media[segmentNumber];
         return this._mediaData.slice(media.offset, media.offset + media.size);
     },
-};
\ No newline at end of file
+
+    concatenateMediaSegments: function(segmentDataList)
+    {
+        var totalLength = 0;
+        segmentDataList.forEach(segment => totalLength += segment.byteLength);
+        var view = new Uint8Array(totalLength);
+        var offset = 0;
+        segmentDataList.forEach(segment => {
+            view.set(new Uint8Array(segment), offset);
+            offset += segment.byteLength;
+        });
+        return view.buffer;
+    },
+};

Modified: trunk/LayoutTests/media/media-source/media-source-seek-unbuffered-expected.txt (282204 => 282205)


--- trunk/LayoutTests/media/media-source/media-source-seek-unbuffered-expected.txt	2021-09-09 09:38:41 UTC (rev 282204)
+++ trunk/LayoutTests/media/media-source/media-source-seek-unbuffered-expected.txt	2021-09-09 10:02:34 UTC (rev 282205)
@@ -8,9 +8,9 @@
 EVENT(update)
 Seek and append a media segment.
 RUN(video.currentTime = 0.8)
-RUN(sourceBuffer.appendBuffer(loader.mediaSegment(0)))
+RUN(sourceBuffer.appendBuffer(loader.concatenateMediaSegments([loader.mediaSegment(0), loader.mediaSegment(1)])))
 EVENT(seeked)
-RUN(sourceBuffer.remove(0.5, 1))
-EXPECTED (true == 'true') OK
+RUN(sourceBuffer.remove(0.5, 2))
+EXPECTED (oldCurrentTime <= video.currentTime == 'true') OK
 END OF TEST
 

Modified: trunk/LayoutTests/media/media-source/media-source-seek-unbuffered.html (282204 => 282205)


--- trunk/LayoutTests/media/media-source/media-source-seek-unbuffered.html	2021-09-09 09:38:41 UTC (rev 282204)
+++ trunk/LayoutTests/media/media-source/media-source-seek-unbuffered.html	2021-09-09 10:02:34 UTC (rev 282205)
@@ -43,15 +43,17 @@
         waitForEventOn(video, 'seeked', videoSeeked, false, true);
         consoleWrite('Seek and append a media segment.')
         run('video.currentTime = 0.8');
-        run('sourceBuffer.appendBuffer(loader.mediaSegment(0))');
+        run('sourceBuffer.appendBuffer(loader.concatenateMediaSegments([loader.mediaSegment(0), loader.mediaSegment(1)]))');
     }
 
+    var oldCurrentTime;
+
     async function videoSeeked() {
-        run('sourceBuffer.remove(0.5, 1)');
+        run('sourceBuffer.remove(0.5, 2)');
         await video.play();
-        const oldCurrentTime = video.currentTime;
+        oldCurrentTime = video.currentTime;
         await sleep(100);
-        testExpected(oldCurrentTime <= video.currentTime , true);
+        testExpected('oldCurrentTime <= video.currentTime' , true);
         endTest();
     }
     </script>
@@ -62,4 +64,4 @@
     </div>
     <video controls></video>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/platform/glib/TestExpectations (282204 => 282205)


--- trunk/LayoutTests/platform/glib/TestExpectations	2021-09-09 09:38:41 UTC (rev 282204)
+++ trunk/LayoutTests/platform/glib/TestExpectations	2021-09-09 10:02:34 UTC (rev 282205)
@@ -678,8 +678,6 @@
 
 webkit.org/b/199617 http/tests/media/hls/hls-video-resize.html [ Skip ]
 
-webkit.org/b/227258 media/media-source/media-source-seek-unbuffered.html [ Timeout ]
-
 webkit.org/b/227661 http/tests/media/hls/hls-webvtt-seek-backwards.html [ Timeout ]
 
 webkit.org/b/227934 media/media-source/media-webm-vorbis-partial.html [ Failure ]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to