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

Unified Diff: media/filters/source_buffer_stream_unittest.cc

Issue 58663003: Fix last_range != range_for_next_append_ DCHECK in SourceBufferStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments Created 7 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 | « media/filters/source_buffer_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/source_buffer_stream_unittest.cc
diff --git a/media/filters/source_buffer_stream_unittest.cc b/media/filters/source_buffer_stream_unittest.cc
index 8d66adc97c6e7b1302e8e66a03e144559439d287..7b525b90b21eb2a8eea0333f6ed937f21cdf928f 100644
--- a/media/filters/source_buffer_stream_unittest.cc
+++ b/media/filters/source_buffer_stream_unittest.cc
@@ -3225,6 +3225,31 @@ TEST_F(SourceBufferStreamTest, Remove_GOPBeingAppended) {
CheckExpectedBuffers("240K 270 300");
}
+
+TEST_F(SourceBufferStreamTest,
+ Remove_PreviousAppendDestroyedAndOverwriteExistingRange) {
+ SeekToTimestamp(base::TimeDelta::FromMilliseconds(90));
+
+ NewSegmentAppend("90K 120 150");
+ CheckExpectedRangesByTimestamp("{ [90,180) }");
+
+ // Append a segment before the previously appended data.
+ NewSegmentAppend("0K 30 60");
+
+ // Verify that the ranges get merged.
+ CheckExpectedRangesByTimestamp("{ [0,180) }");
+
+ // Remove the data from the last append.
+ RemoveInMs(0, 90, 360);
+ CheckExpectedRangesByTimestamp("{ [90,180) }");
+
+ // Append a new segment that follows the removed segment and
+ // starts at the beginning of the range left over from the
+ // remove.
+ NewSegmentAppend("90K 121 151");
+ CheckExpectedBuffers("90K 121 151");
+}
+
// TODO(vrk): Add unit tests where keyframes are unaligned between streams.
// (crbug.com/133557)
« no previous file with comments | « media/filters/source_buffer_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698