Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: LayoutTests/http/tests/media/media-source/mediasource-errors.html

Issue 742653002: MSE: Add layout test for 'decode' error via an algorithm (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-errors-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/media/media-source/mediasource-errors.html
diff --git a/LayoutTests/http/tests/media/media-source/mediasource-errors.html b/LayoutTests/http/tests/media/media-source/mediasource-errors.html
index bb839522155b8a2d222ba16f977886464d8a5c76..c69bf83ecb522c8ff759e1496763706194434d23 100644
--- a/LayoutTests/http/tests/media/media-source/mediasource-errors.html
+++ b/LayoutTests/http/tests/media/media-source/mediasource-errors.html
@@ -143,6 +143,28 @@
test.done();
});
}, "Signaling 'network' error via endOfStream() after initialization segment has been appended and the HTMLMediaElement has reached HAVE_METADATA.");
+
+ ErrorTest(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
+ {
+ assert_equals(mediaElement.readyState, HTMLMediaElement.HAVE_NOTHING);
+
+ var initSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.init);
+ var mediaSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[0]);
+ var index = (mediaSegment.length + 1) / 5;
philipj_slow 2014/11/19 10:08:35 This and the follow line looks a bit odd, like som
jiajia.qin 2014/11/19 11:57:57 Yes. I am trying to create a buffer that includes
+ var partialMediaSegment = mediaSegment.subarray(index * 2);
+ mediaData.set(partialMediaSegment, initSegment.length + index);
+
+ test.expectEvent(mediaElement, "error", "mediaElement error.");
+ sourceBuffer.appendBuffer(mediaData);
+
+ test.waitForExpectedEvents(function()
+ {
+ assert_equals(mediaElement.readyState, HTMLMediaElement.HAVE_METADATA);
+ assert_true(mediaElement.error != null);
+ assert_equals(mediaElement.error.code, MediaError.MEDIA_ERR_DECODE);
+ test.done();
+ });
+ }, "Signaling 'decode' error via segment parser loop algorithm after initialization segment and partial media segment has been appended.");
</script>
</body>
</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-errors-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698