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

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

Issue 245893002: Improve unprefixed MediaSource test coverage. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months 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
Index: LayoutTests/http/tests/media/media-source/mediasource-timestamp-offset.html
diff --git a/LayoutTests/http/tests/media/media-source/mediasource-timestamp-offset.html b/LayoutTests/http/tests/media/media-source/mediasource-timestamp-offset.html
index 7e7a3d383eeab0d6df81a1530ad63aa0e12f9264..512e08551041de966ad11dd25dca6210dd8930fc 100644
--- a/LayoutTests/http/tests/media/media-source/mediasource-timestamp-offset.html
+++ b/LayoutTests/http/tests/media/media-source/mediasource-timestamp-offset.html
@@ -41,6 +41,40 @@
simpleTimestampOffsetTest(true, 1, 'true');
simpleTimestampOffsetTest('10.5', 10.5, 'a number string');
simpleTimestampOffsetTest('', 0, 'an empty string');
+
+ mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
+ {
+ var initSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.init);
+ var mediaSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[0]);
+
+ test.expectEvent(sourceBuffer, "updateend", "initSegment append ended.");
+ sourceBuffer.appendBuffer(initSegment);
+
+ test.waitForExpectedEvents(function()
+ {
+ test.expectEvent(sourceBuffer, "updateend", "mediaSegment append ended.");
+ sourceBuffer.appendBuffer(mediaSegment);
+ });
+
+ test.waitForExpectedEvents(function()
+ {
+ mediaSource.endOfStream();
+
+ assert_equals(mediaSource.readyState, "ended");
+
+ mediaSource.sourceBuffers[0].timestampOffset = 2;
+
+ assert_equals(mediaSource.readyState, "open");
+
+ test.expectEvent(mediaSource, "sourceopen", "mediaSource fired 'sourceopen' event.");
+ });
+
+ test.waitForExpectedEvents(function()
+ {
+ test.done();
+ });
+ }, "Test setting timestampOffset in 'ended' state causes a transition to 'open'.");
+
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698