chromium/media/filters/source_buffer_stream_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "media/filters/source_buffer_stream.h"

#include <stddef.h>
#include <stdint.h>

#include <memory>
#include <string>
#include <vector>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "media/base/data_buffer.h"
#include "media/base/decoder_buffer.h"
#include "media/base/media_log.h"
#include "media/base/media_switches.h"
#include "media/base/media_util.h"
#include "media/base/mock_media_log.h"
#include "media/base/test_helpers.h"
#include "media/base/timestamp_constants.h"
#include "media/base/webvtt_util.h"
#include "media/filters/source_buffer_range.h"
#include "testing/gtest/include/gtest/gtest.h"

HasSubstr;
InSequence;
StrictMock;

namespace {

enum class TimeGranularity {};

}  // namespace

namespace media {

BufferQueue;

static const int kDefaultFramesPerSecond =;
static const int kDefaultKeyframesPerSecond =;
static const uint8_t kDataA =;
static const uint8_t kDataB =;
static const size_t kDataSize =;

// Matchers for verifying common media log entry strings.
MATCHER_P(ContainsTrackBufferExhaustionSkipLog, skip_milliseconds, "") {}

#define EXPECT_STATUS_FOR_STREAM_OP(status_suffix, operation)

class SourceBufferStreamTest : public testing::Test {};

TEST_F(SourceBufferStreamTest, Append_SingleRange) {}

TEST_F(SourceBufferStreamTest, Append_SingleRange_OneBufferAtATime) {}

TEST_F(SourceBufferStreamTest, Append_DisjointRanges) {}

TEST_F(SourceBufferStreamTest, Append_AdjacentRanges) {}

TEST_F(SourceBufferStreamTest, Complete_Overlap) {}

TEST_F(SourceBufferStreamTest,
       Complete_Overlap_AfterGroupTimestampAndBeforeFirstBufferTimestamp) {}

TEST_F(SourceBufferStreamTest, Complete_Overlap_EdgeCase) {}

TEST_F(SourceBufferStreamTest, Start_Overlap) {}

TEST_F(SourceBufferStreamTest, End_Overlap) {}

// Using position based test API:
// DTS  :  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
// PTS  :  0  4  1  2  3  5  9  6  7  8 10 14 11 12 13 15 19 16 17 18 20
// old  :                                A  a  a  a  a  A  a  a  a  a
// new  :                 B  b  b  b  b  B  b  b
// after:                 B  b  b  b  b  B  b  b        A  a  a  a  a
TEST_F(SourceBufferStreamTest, End_Overlap_Several) {}

// Test an end overlap edge case where a single buffer overlaps the
// beginning of a range.
// old  : 0K   30   60   90   120K  150
// new  : 0K
// after: 0K                  120K  150
// track:
TEST_F(SourceBufferStreamTest, End_Overlap_SingleBuffer) {}

// Using position based test API:
// DTS  :  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// PTS  :  0 4 1 2 3 5 9 6 7 8 0 4 1 2 3 5 9 6 7 8 0 4 1 2 3 5 9 6 7 8 0
// old  :            A a                 A a                 A a
// new  :  B b b b b B b b b b B b b b b B b b b b B b b b b B b b b b
// after == new
TEST_F(SourceBufferStreamTest, Complete_Overlap_Several) {}

// Using position based test API:
// DTS:0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
// PTS:0 4 1 2 3 5 9 6 7 8 0 4 1 2 3 5 9 6 7 8 0 4 1 2 3 5 9 6 7 8 0 4 1 2 3 5 9
// old:          A a                 A a                 A a                 A a
// new:B b b b b B b b b b B b b b b B b b b b B b b b b B b b b b B b b b b
TEST_F(SourceBufferStreamTest, Complete_Overlap_Several_Then_Merge) {}

TEST_F(SourceBufferStreamTest, Complete_Overlap_Selected) {}

// This test is testing that a client can append data to SourceBufferStream that
// overlaps the range from which the client is currently grabbing buffers. We
// would expect that the SourceBufferStream would return old data until it hits
// the keyframe of the new data, after which it will return the new data.
TEST_F(SourceBufferStreamTest, Complete_Overlap_Selected_TrackBuffer) {}

TEST_F(SourceBufferStreamTest, Complete_Overlap_Selected_EdgeCase) {}

TEST_F(SourceBufferStreamTest, Complete_Overlap_Selected_Multiple) {}

TEST_F(SourceBufferStreamTest, Start_Overlap_Selected) {}

TEST_F(SourceBufferStreamTest, Start_Overlap_Selected_TrackBuffer) {}

TEST_F(SourceBufferStreamTest, Start_Overlap_Selected_EdgeCase) {}

// This test covers the case where new buffers end-overlap an existing, selected
// range, and the next buffer is a keyframe that's being overlapped by new
// buffers.
// index:  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// old  :           *A*a a a a A a a a a
// new  :  B b b b b B b b b b
// after:  B b b b b*B*b b b b A a a a a
TEST_F(SourceBufferStreamTest, End_Overlap_Selected) {}

// This test covers the case where new buffers end-overlap an existing, selected
// range, and the next buffer in the range is after the newly appended buffers.
//
// index:  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// old  :           |A a a a a A a a*a*a|
// new  :  B b b b b B b b b b
// after: |B b b b b B b b b b A a a*a*a|
TEST_F(SourceBufferStreamTest, End_Overlap_Selected_AfterEndOfNew_1) {}

// Using position based test API:
// This test covers the case where new buffers end-overlap an existing, selected
// range, and the next buffer in the range is after the newly appended buffers.
//
// DTS  :  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// PTS  :  0 4 1 2 3 5 9 6 7 8 0 4 1 2 3 5 9 6 7 8 0
// old  :            A a a a a A a a*a*a
// new  :  B b b b b B b b
// after:  B b b b b B b b     A a a*a*a
TEST_F(SourceBufferStreamTest, End_Overlap_Selected_AfterEndOfNew_2) {}

// Using position based test API:
// This test covers the case where new buffers end-overlap an existing, selected
// range, and the next buffer in the range is after the newly appended buffers.
//
// DTS  :  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// PTS  :  0 4 1 2 3 5 9 6 7 8 0 4 1 2 3 5 9 6 7 8 0
// old  :            A a a*a*a A a a a a
// new  :  B b b b b B b b
// after:  B b b b b B b b     A a a a a
// track:                  a a
TEST_F(SourceBufferStreamTest, End_Overlap_Selected_AfterEndOfNew_3) {}

// This test covers the case where new buffers end-overlap an existing, selected
// range, and the next buffer in the range is overlapped by the new buffers.
//
// index:  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// old  :           |A a a*a*a A a a a a|
// new  :  B b b b b B b b b b
// after: |B b b b b B b b b b A a a a a|
// track:                 |a a|
TEST_F(SourceBufferStreamTest, End_Overlap_Selected_OverlappedByNew_1) {}

// Using position based test API:
// This test covers the case where new buffers end-overlap an existing, selected
// range, and the next buffer in the range is overlapped by the new buffers.
//
// DTS  :  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// PTS  :  0 4 1 2 3 5 9 6 7 8 0 4 1 2 3 5 9 6 7 8 0
// old  :            A*a*a a a A a a a a
// new  :  B b b b b B b
// after:  B b b b b B b       A a a a a
// track:              a a a a
TEST_F(SourceBufferStreamTest, End_Overlap_Selected_OverlappedByNew_2) {}

// Using position based test API:
// This test covers the case where new buffers end-overlap an existing, selected
// range, and the next buffer in the range is overlapped by the new buffers.
// In this particular case, the next keyframe after the track buffer is in the
// range with the new buffers.
//
// DTS  :  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// PTS  :  0 4 1 2 3 5 9 6 7 8 0 4 1 2 3 5 9 6 7 8 0
// old  :            A*a*a a a A a a a a A a a a a
// new  :  B b b b b B b b b b B
// after:  B b b b b B b b b b B         A a a a a
// track:              a a a a
TEST_F(SourceBufferStreamTest, End_Overlap_Selected_OverlappedByNew_3) {}

// This test covers the case where new buffers end-overlap an existing, selected
// range, and there is no keyframe after the end of the new buffers.
// index:  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// old  :           |A*a*a a a|
// new  :  B b b b b B
// after: |B b b b b B|
// track:             |a a a a|
TEST_F(SourceBufferStreamTest, End_Overlap_Selected_NoKeyframeAfterNew) {}

// Using position based test API:
// This test covers the case where new buffers end-overlap an existing, selected
// range, and there is no keyframe after the end of the new buffers, then more
// buffers end-overlap the beginning.
// DTS  :  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// PTS :   0 4 1 2 3 5 9 6 7 8 0 4 1 2 3 5 9 6 7 8 0
// old  :                      A a a a a A*a*
// new  :            B b b b b B b b b b B
// after:            B b b b b B b b b b B
// new  :  A a a a a A
// after:  A a a a a A         B b b b b B
// track:                                  a
// new  :                                B b b b b B
// after:  A a a a a A         B b b b b B b b b b B
TEST_F(SourceBufferStreamTest, End_Overlap_Selected_NoKeyframeAfterNew2) {}

// This test covers the case where new buffers end-overlap an existing, selected
// range, and the next keyframe in a separate range.
// index:  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// old  :           |A*a*a a a|         |A a a a a|
// new  :  B b b b b B
// after: |B b b b b B|                 |A a a a a|
// track:             |a a a a|
TEST_F(SourceBufferStreamTest, End_Overlap_Selected_NoKeyframeAfterNew3) {}

// This test covers the case when new buffers overlap the middle of a selected
// range. This tests the case when there is precise overlap of an existing GOP,
// and the next buffer is a keyframe.
// index:  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// old  :  A a a a a*A*a a a a A a a a a
// new  :            B b b b b
// after:  A a a a a*B*b b b b A a a a a
TEST_F(SourceBufferStreamTest, Middle_Overlap_Selected_1) {}

// This test covers the case when new buffers overlap the middle of a selected
// range. This tests the case when there is precise overlap of an existing GOP,
// and the next buffer is a non-keyframe in a GOP after the new buffers.
// index:  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// old  :  A a a a a A a a a a A*a*a a a
// new  :            B b b b b
// after:  A a a a a B b b b b A*a*a a a
TEST_F(SourceBufferStreamTest, Middle_Overlap_Selected_2) {}

// This test covers the case when new buffers overlap the middle of a selected
// range. This tests the case when only a partial GOP is appended, that append
// is merged into the overlapped range, and the next buffer is before the new
// buffers.
// index:  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// old  :  A a*a*a a A a a a a A a a a a
// new  :            B
// after:  A a*a*a a B         A a a a a
TEST_F(SourceBufferStreamTest, Middle_Overlap_Selected_3) {}

// This test covers the case when new buffers overlap the middle of a selected
// range. This tests the case when only a partial GOP is appended, and the next
// buffer is after the new buffers, and comes from the track buffer until the
// next GOP in the original buffers.
// index:  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
// old  :  A a a a a A a a*a*a A a a a a
// new  :            B
// after:  A a a a a B         A a a a a
// track:                  a a
TEST_F(SourceBufferStreamTest, Middle_Overlap_Selected_4) {}

TEST_F(SourceBufferStreamTest, Overlap_OneByOne) {}

TEST_F(SourceBufferStreamTest, Overlap_OneByOne_DeleteGroup) {}

TEST_F(SourceBufferStreamTest, Overlap_OneByOne_BetweenCodedFrameGroups) {}

// old  :   10K  40  *70*  100K  125  130K
// new  : 0K   30   60   90   120K
// after: 0K   30   60   90  *120K*   130K
TEST_F(SourceBufferStreamTest, Overlap_OneByOne_TrackBuffer) {}

// Overlap the next keyframe after the end of the track buffer with a new
// keyframe.
// old  :   10K  40  *70*  100K  125  130K
// new  : 0K   30   60   90   120K
// after: 0K   30   60   90  *120K*   130K
// track:             70
// new  :                     110K    130
// after: 0K   30   60   90  *110K*   130
TEST_F(SourceBufferStreamTest, Overlap_OneByOne_TrackBuffer2) {}

// Overlap the next keyframe after the end of the track buffer without a
// new keyframe.
// old  :   10K  40  *70*  100K  125  130K
// new  : 0K   30   60   90   120K
// after: 0K   30   60   90  *120K*   130K
// track:             70
// new  :        50K   80   110          140
// after: 0K   30   50K   80   110   140 * (waiting for keyframe)
// track:             70
TEST_F(SourceBufferStreamTest, Overlap_OneByOne_TrackBuffer3) {}

// Overlap the next keyframe after the end of the track buffer with a keyframe
// that comes before the end of the track buffer.
// old  :   10K  40  *70*  100K  125  130K
// new  : 0K   30   60   90   120K
// after: 0K   30   60   90  *120K*   130K
// track:             70
// new  :              80K  110          140
// after: 0K   30   60   *80K*  110   140
// track:               70
TEST_F(SourceBufferStreamTest, Overlap_OneByOne_TrackBuffer4) {}

// Overlap the next keyframe after the end of the track buffer with a keyframe
// that comes before the end of the track buffer, when the selected stream was
// waiting for the next keyframe.
// old  :   10K  40  *70*  100K
// new  : 0K   30   60   90   120
// after: 0K   30   60   90   120 * (waiting for keyframe)
// track:             70
// new  :              80K  110          140
// after: 0K   30   60   *80K*  110   140
// track:               70
TEST_F(SourceBufferStreamTest, Overlap_OneByOne_TrackBuffer5) {}

// Test that appending to a different range while there is data in
// the track buffer doesn't affect the selected range or track buffer state.
// old  :   10K  40  *70*  100K  125  130K ... 200K 230
// new  : 0K   30   60   90   120K
// after: 0K   30   60   90  *120K*   130K ... 200K 230
// track:             70
// old  : 0K   30   60   90  *120K*   130K ... 200K 230
// new  :                                               260K 290
// after: 0K   30   60   90  *120K*   130K ... 200K 230 260K 290
// track:             70
TEST_F(SourceBufferStreamTest, Overlap_OneByOne_TrackBuffer6) {}

// Test that overlap-appending with a GOP that begins with time of next track
// buffer frame drops that track buffer frame and buffers the new GOP correctly.
// append :    10K   40    70     100
// read the first two buffers
// after  :    10K   40   *70*    100
//
// append : 0K    30    60    90    120
// after  : 0K    30    60    90    120
// track  :               *70*    100
//
// read the buffer at 70ms from track
// after  : 0K    30    60    90    120
// track  :                      *100*
//
// append :                       100K   130
// after  : 0K    30    60    90 *100K*  130
// track  : (empty)
// 100K, not 100, should be the next buffer read.
TEST_F(SourceBufferStreamTest,
       Overlap_That_Prunes_All_of_Previous_TrackBuffer) {}

TEST_F(SourceBufferStreamTest, Seek_Keyframe) {}

TEST_F(SourceBufferStreamTest, Seek_NonKeyframe) {}

TEST_F(SourceBufferStreamTest, Seek_NotBuffered) {}

TEST_F(SourceBufferStreamTest, Seek_InBetweenTimestamps) {}

// This test will do a complete overlap of an existing range in order to add
// buffers to the track buffers. Then the test does a seek to another part of
// the stream. The SourceBufferStream should clear its internal track buffer in
// response to the Seek().
TEST_F(SourceBufferStreamTest, Seek_After_TrackBuffer_Filled) {}

TEST_F(SourceBufferStreamTest, Seek_StartOfGroup) {}

TEST_F(SourceBufferStreamTest, Seek_BeforeStartOfGroup) {}

TEST_F(SourceBufferStreamTest, OldSeekPoint_CompleteOverlap) {}

TEST_F(SourceBufferStreamTest, OldSeekPoint_CompleteOverlap_Pending) {}

TEST_F(SourceBufferStreamTest, OldSeekPoint_MiddleOverlap) {}

TEST_F(SourceBufferStreamTest, OldSeekPoint_MiddleOverlap_Pending) {}

TEST_F(SourceBufferStreamTest, OldSeekPoint_StartOverlap) {}

TEST_F(SourceBufferStreamTest, OldSeekPoint_StartOverlap_Pending) {}

TEST_F(SourceBufferStreamTest, OldSeekPoint_EndOverlap) {}

TEST_F(SourceBufferStreamTest, OldSeekPoint_EndOverlap_Pending) {}

TEST_F(SourceBufferStreamTest, GetNextBuffer_AfterMerges) {}

TEST_F(SourceBufferStreamTest, GetNextBuffer_ExhaustThenAppend) {}

// This test covers the case where new buffers start-overlap a range whose next
// buffer is not buffered.
TEST_F(SourceBufferStreamTest, GetNextBuffer_ExhaustThenStartOverlap) {}

// Tests a start overlap that occurs right at the timestamp of the last output
// buffer that was returned by GetNextBuffer(). This test verifies that
// GetNextBuffer() skips to second GOP in the newly appended data instead
// of returning two buffers with the same timestamp.
TEST_F(SourceBufferStreamTest, GetNextBuffer_ExhaustThenStartOverlap2) {}

// This test covers the case where new buffers completely overlap a range
// whose next buffer is not buffered.
TEST_F(SourceBufferStreamTest, GetNextBuffer_ExhaustThenCompleteOverlap) {}

// This test covers the case where a range is stalled waiting for its next
// buffer, then an end-overlap causes the end of the range to be deleted.
TEST_F(SourceBufferStreamTest, GetNextBuffer_ExhaustThenEndOverlap) {}

// This test is testing the "next buffer" logic after a complete overlap. In
// this scenario, when the track buffer is exhausted, there is no buffered data
// to fulfill the request. The SourceBufferStream should be able to fulfill the
// request when the data is later appended, and should not lose track of the
// "next buffer" position.
TEST_F(SourceBufferStreamTest, GetNextBuffer_Overlap_Selected_Complete) {}

TEST_F(SourceBufferStreamTest, PresentationTimestampIndependence) {}

TEST_F(SourceBufferStreamTest, GarbageCollection_DeleteFront) {}

TEST_F(SourceBufferStreamTest,
       GarbageCollection_DeleteFront_PreserveSeekedGOP) {}

TEST_F(SourceBufferStreamTest, GarbageCollection_DeleteFrontGOPsAtATime) {}

TEST_F(SourceBufferStreamTest, GarbageCollection_DeleteBack) {}

TEST_F(SourceBufferStreamTest, GarbageCollection_DeleteFrontAndBack) {}

TEST_F(SourceBufferStreamTest, GarbageCollection_DeleteSeveralRanges) {}

TEST_F(SourceBufferStreamTest, GarbageCollection_DeleteAfterLastAppend) {}

TEST_F(SourceBufferStreamTest, GarbageCollection_DeleteAfterLastAppendMerged) {}

TEST_F(SourceBufferStreamTest, GarbageCollection_NoSeek) {}

TEST_F(SourceBufferStreamTest, GarbageCollection_PendingSeek) {}

TEST_F(SourceBufferStreamTest, GarbageCollection_NeedsMoreData) {}

// Using position based test API:
// DTS  :  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
// PTS  :  0 4 1 2 3 5 9 6 7 8 0 4 1 2 3 5 9 6 7 8 0 4 1 2 3
// old  :  A a a a a A a a a a A a a a a*A*a a
//       -- Garbage Collect --
// after:                                A a a
//       -- Read one buffer --
// after:                                A*a*a
// new  :  B b b b b B b b b b B b b b b B b b b b
// track:                                 *a*a
//       -- Garbage Collect --
// after:                                B b b b b
// track:                                 *a*a
//       -- Read 2 buffers -> exhausts track buffer
// after:                                B b b b b
//       (awaiting next keyframe after GOP at position 15)
// new  :                                         *B*b b b b
// after:                                B b b b b*B*b b b b
//       -- Garbage Collect --
// after:                                         *B*b b b b
TEST_F(SourceBufferStreamTest, GarbageCollection_TrackBuffer) {}

// Test GC preserves data starting at first GOP containing playback position.
TEST_F(SourceBufferStreamTest, GarbageCollection_SaveDataAtPlaybackPosition) {}

// Test saving the last GOP appended when this GOP is the only GOP in its range.
TEST_F(SourceBufferStreamTest, GarbageCollection_SaveAppendGOP) {}

// Test saving the last GOP appended when this GOP is in the middle of a
// non-selected range.
TEST_F(SourceBufferStreamTest, GarbageCollection_SaveAppendGOP_Middle) {}

// Test saving the last GOP appended when the GOP containing the next buffer is
// adjacent to the last GOP appended.
TEST_F(SourceBufferStreamTest, GarbageCollection_SaveAppendGOP_Selected1) {}

// Test saving the last GOP appended when it is at the beginning or end of the
// selected range. This tests when the last GOP appended is before or after the
// GOP containing the next buffer, but not directly adjacent to this GOP.
TEST_F(SourceBufferStreamTest, GarbageCollection_SaveAppendGOP_Selected2) {}

// Test saving the last GOP appended when it is the same as the GOP containing
// the next buffer.
TEST_F(SourceBufferStreamTest, GarbageCollection_SaveAppendGOP_Selected3) {}

// Test the performance of garbage collection.
TEST_F(SourceBufferStreamTest, GarbageCollection_Performance) {}

TEST_F(SourceBufferStreamTest, GarbageCollection_MediaTimeAfterLastAppendTime) {}

TEST_F(SourceBufferStreamTest,
       GarbageCollection_MediaTimeOutsideOfStreamBufferedRange) {}

TEST_F(SourceBufferStreamTest, GetRemovalRange_BytesToFree) {}

TEST_F(SourceBufferStreamTest, GetRemovalRange_Range) {}

TEST_F(SourceBufferStreamTest, IsNextBufferConfigChanged) {}

TEST_F(SourceBufferStreamTest, ConfigChange_Basic) {}

TEST_F(SourceBufferStreamTest, ConfigChange_Seek) {}

TEST_F(SourceBufferStreamTest, SetExplicitDuration) {}

TEST_F(SourceBufferStreamTest, SetExplicitDuration_EdgeCase) {}

TEST_F(SourceBufferStreamTest, SetExplicitDuration_EdgeCase2) {}

TEST_F(SourceBufferStreamTest, RemoveWithinFudgeRoom) {}

TEST_F(SourceBufferStreamTest, SetExplicitDuration_DeletePartialRange) {}

TEST_F(SourceBufferStreamTest, SetExplicitDuration_DeleteSelectedRange) {}

TEST_F(SourceBufferStreamTest, SetExplicitDuration_DeletePartialSelectedRange) {}

// Test the case where duration is set while the stream parser buffers
// already start passing the data to decoding pipeline. Selected range,
// when invalidated by getting truncated, should be updated to NULL
// accordingly so that successive append operations keep working.
TEST_F(SourceBufferStreamTest, SetExplicitDuration_UpdateSelectedRange) {}

TEST_F(SourceBufferStreamTest,
       SetExplicitDuration_AfterGroupTimestampAndBeforeFirstBufferTimestamp) {}

TEST_F(SourceBufferStreamTest, SetExplicitDuration_MarkEOS) {}

TEST_F(SourceBufferStreamTest, SetExplicitDuration_MarkEOS_IsSeekPending) {}

// Test the case were the current playback position is at the end of the
// buffered data and several overlaps occur.
TEST_F(SourceBufferStreamTest, OverlapWhileWaitingForMoreData) {}

// Verify that a single coded frame at the current read position unblocks the
// read even if the frame is buffered after the previously read position is
// removed.
TEST_F(SourceBufferStreamTest, AfterRemove_SingleFrameRange_Unblocks_Read) {}

// Verify that multiple short (relative to max-inter-buffer-distance * 2) coded
// frames at the current read position unblock the read even if the frames are
// buffered after the previously read position is removed.
TEST_F(SourceBufferStreamTest, AfterRemove_TinyFrames_Unblock_Read_1) {}

// Verify that multiple short (relative to max-inter-buffer-distance * 2) coded
// frames starting at the fudge room boundary unblock the read even if the
// frames are buffered after the previously read position is removed.
TEST_F(SourceBufferStreamTest, AfterRemove_TinyFrames_Unblock_Read_2) {}

// Verify that coded frames starting after the fudge room boundary do not
// unblock the read when buffered after the previously read position is removed.
TEST_F(SourceBufferStreamTest, AfterRemove_BeyondFudge_Stalled) {}

// Verify that non-keyframes with the same timestamp in the same
// append are handled correctly.
TEST_F(SourceBufferStreamTest, SameTimestamp_Video_SingleAppend) {}

// Verify that a non-keyframe followed by a keyframe with the same timestamp
// is allowed.
TEST_F(SourceBufferStreamTest, SameTimestamp_Video_SingleAppend2) {}

// Verify that non-keyframes with the same timestamp can occur
// in different appends.
TEST_F(SourceBufferStreamTest, SameTimestamp_Video_TwoAppends) {}

// Verify that a non-keyframe followed by a keyframe with the same timestamp
// is allowed.
TEST_F(SourceBufferStreamTest, SameTimestamp_Video_TwoAppends2) {}

// Verify that a keyframe followed by a non-keyframe with the same timestamp
// is allowed.
TEST_F(SourceBufferStreamTest, SameTimestamp_VideoKeyFrame_TwoAppends) {}

TEST_F(SourceBufferStreamTest, SameTimestamp_VideoKeyFrame_SingleAppend) {}

TEST_F(SourceBufferStreamTest, SameTimestamp_Video_Overlap_1) {}

TEST_F(SourceBufferStreamTest, SameTimestamp_Video_Overlap_2) {}

TEST_F(SourceBufferStreamTest, SameTimestamp_Video_Overlap_3) {}

// Test all the valid same timestamp cases for audio.
TEST_F(SourceBufferStreamTest, SameTimestamp_Audio) {}

// If seeking past any existing range and the seek is pending
// because no data has been provided for that position,
// the stream position can be considered as the end of stream.
TEST_F(SourceBufferStreamTest, EndSelected_During_PendingSeek) {}

// If there is a pending seek between 2 existing ranges,
// the end of the stream has not been reached.
TEST_F(SourceBufferStreamTest, EndNotSelected_During_PendingSeek) {}

// Removing exact start & end of a range.
TEST_F(SourceBufferStreamTest, Remove_WholeRange1) {}

// Removal range starts before range and ends exactly at end.
TEST_F(SourceBufferStreamTest, Remove_WholeRange2) {}

// Removal range starts at the start of a range and ends beyond the
// range end.
TEST_F(SourceBufferStreamTest, Remove_WholeRange3) {}

// Removal range starts before range start and ends after the range end.
TEST_F(SourceBufferStreamTest, Remove_WholeRange4) {}

// Removes multiple ranges.
TEST_F(SourceBufferStreamTest, Remove_WholeRange5) {}

// Verifies a [0-infinity) range removes everything.
TEST_F(SourceBufferStreamTest, Remove_ZeroToInfinity) {}

// Removal range starts at the beginning of the range and ends in the
// middle of the range. This test verifies that full GOPs are removed.
TEST_F(SourceBufferStreamTest, Remove_Partial1) {}

// Removal range starts in the middle of a range and ends at the exact
// end of the range.
TEST_F(SourceBufferStreamTest, Remove_Partial2) {}

// Removal range starts and ends within a range.
TEST_F(SourceBufferStreamTest, Remove_Partial3) {}

// Removal range starts in the middle of one range and ends in the
// middle of another range.
TEST_F(SourceBufferStreamTest, Remove_Partial4) {}

// Test behavior when the current position is removed and new buffers
// are appended over the removal range.
TEST_F(SourceBufferStreamTest, Remove_CurrentPosition) {}

// Test behavior when buffers in the selected range before the current position
// are removed.
TEST_F(SourceBufferStreamTest, Remove_BeforeCurrentPosition) {}

// Test removing the preliminary portion for the current coded frame group being
// appended.
TEST_F(SourceBufferStreamTest, Remove_MidGroup) {}

// Test removing the current GOP being appended, while not removing
// the entire range the GOP belongs to.
TEST_F(SourceBufferStreamTest, Remove_GOPBeingAppended) {}

TEST_F(SourceBufferStreamTest, Remove_WholeGOPBeingAppended) {}

TEST_F(SourceBufferStreamTest,
       Remove_PreviousAppendDestroyedAndOverwriteExistingRange) {}

TEST_F(SourceBufferStreamTest, Remove_GapAtBeginningOfGroup) {}

TEST_F(SourceBufferStreamTest,
       OverlappingAppendRangeMembership_OneMicrosecond_Video) {}

TEST_F(SourceBufferStreamTest,
       OverlappingAppendRangeMembership_TwoMicroseconds_Video) {}

TEST_F(SourceBufferStreamTest, Audio_SpliceTrimmingForOverlap) {}

// Test that a splice is not created if an end timestamp and start timestamp
// perfectly overlap.
TEST_F(SourceBufferStreamTest, Audio_SpliceFrame_NoSplice) {}

TEST_F(SourceBufferStreamTest, Audio_NoSpliceForBadOverlap) {}

TEST_F(SourceBufferStreamTest, Audio_NoSpliceForEstimatedDuration) {}

TEST_F(SourceBufferStreamTest, Audio_SpliceTrimming_ExistingTrimming) {}

TEST_F(SourceBufferStreamTest, Audio_SpliceFrame_NoMillisecondSplices) {}

TEST_F(SourceBufferStreamTest, Audio_PrerollFrame) {}

TEST_F(SourceBufferStreamTest, Audio_ConfigChangeWithPreroll) {}

TEST_F(SourceBufferStreamTest, Audio_Opus_SeekToJustBeforeRangeStart) {}

TEST_F(SourceBufferStreamTest, BFrames) {}

TEST_F(SourceBufferStreamTest, RemoveShouldAlwaysExcludeEnd) {}

TEST_F(SourceBufferStreamTest, RefinedDurationEstimates_BackOverlap) {}

TEST_F(SourceBufferStreamTest, RefinedDurationEstimates_FrontOverlap) {}

TEST_F(SourceBufferStreamTest, SeekToStartSatisfiedUpToThreshold) {}

TEST_F(SourceBufferStreamTest, SeekToStartUnsatisfiedBeyondThreshold) {}

TEST_F(SourceBufferStreamTest,
       ReSeekToStartSatisfiedUpToThreshold_SameTimestamps) {}

TEST_F(SourceBufferStreamTest,
       ReSeekToStartSatisfiedUpToThreshold_EarlierTimestamps) {}

TEST_F(SourceBufferStreamTest,
       ReSeekToStartSatisfiedUpToThreshold_LaterTimestamps) {}

TEST_F(SourceBufferStreamTest, ReSeekBeyondStartThreshold_SameTimestamps) {}

TEST_F(SourceBufferStreamTest, ReSeekBeyondThreshold_EarlierTimestamps) {}

TEST_F(SourceBufferStreamTest, ConfigChange_ReSeek) {}

TEST_F(SourceBufferStreamTest, TrackBuffer_ExhaustionWithSkipForward) {}

TEST_F(SourceBufferStreamTest,
       TrackBuffer_ExhaustionAndImmediateNewTrackBuffer) {}

TEST_F(
    SourceBufferStreamTest,
    AdjacentCodedFrameGroupContinuation_NoGapCreatedByTinyGapInGroupContinuation) {}

TEST_F(SourceBufferStreamTest,
       AdjacentCodedFrameGroupContinuation_NoGapCreatedPrefixRemoved) {}

TEST_F(SourceBufferStreamTest,
       AdjacentNewCodedFrameGroupContinuation_NoGapCreatedPrefixRemoved) {}

TEST_F(SourceBufferStreamTest,
       StartCodedFrameGroup_RemoveThenAppendMoreMuchLater) {}

TEST_F(SourceBufferStreamTest,
       StartCodedFrameGroup_InExisting_AppendMuchLater) {}

TEST_F(SourceBufferStreamTest,
       StartCodedFrameGroup_InExisting_RemoveGOP_ThenAppend_1) {}

TEST_F(SourceBufferStreamTest,
       StartCodedFrameGroup_InExisting_RemoveGOP_ThenAppend_2) {}

TEST_F(SourceBufferStreamTest,
       StartCodedFrameGroup_InExisting_RemoveMostRecentAppend_ThenAppend_1) {}

TEST_F(SourceBufferStreamTest,
       StartCodedFrameGroup_InExisting_RemoveMostRecentAppend_ThenAppend_2) {}

TEST_F(SourceBufferStreamTest, GetLowestPresentationTimestamp_NonMuxed) {}

TEST_F(SourceBufferStreamTest, GetLowestPresentationTimestamp_Muxed) {}

TEST_F(SourceBufferStreamTest, GetHighestPresentationTimestamp) {}

TEST_F(SourceBufferStreamTest, GarbageCollectionUnderMemoryPressure) {}

TEST_F(SourceBufferStreamTest, InstantGarbageCollectionUnderMemoryPressure) {}

TEST_F(SourceBufferStreamTest, GCFromFrontThenExplicitRemoveFromMiddleToEnd) {}

TEST_F(SourceBufferStreamTest, BFrames_WithoutEditList) {}

TEST_F(SourceBufferStreamTest, OverlapSameTimestampWithinSameGOP) {}

struct VideoEndTimeCase {};

TEST_F(SourceBufferStreamTest, VideoRangeEndTimeCases) {}

struct AudioEndTimeCase {};

TEST_F(SourceBufferStreamTest, AudioRangeEndTimeCases) {}

TEST_F(SourceBufferStreamTest, SameTimestampEstimatedDurations_Video) {}

TEST_F(SourceBufferStreamTest, RangeIsNextInPTS_Simple) {}

TEST_F(SourceBufferStreamTest, RangeIsNextInPTS_OutOfOrder) {}

TEST_F(SourceBufferStreamTest, RangeCoalescenceOnFudgeRoomIncrease_1) {}

TEST_F(SourceBufferStreamTest, RangeCoalescenceOnFudgeRoomIncrease_2) {}

TEST_F(SourceBufferStreamTest, NoRangeGapWhenIncrementallyOverlapped) {}

TEST_F(SourceBufferStreamTest, AllowIncrementalAppendsToCoalesceRangeGap) {}

TEST_F(SourceBufferStreamTest, PreciselyOverlapLastAudioFrameAppended_1) {}

TEST_F(SourceBufferStreamTest, PreciselyOverlapLastAudioFrameAppended_2) {}

TEST_F(SourceBufferStreamTest, ZeroDurationBuffersThenIncreasingFudgeRoom) {}

TEST_F(SourceBufferStreamTest, NonZeroDurationBuffersThenIncreasingFudgeRoom) {}

TEST_F(SourceBufferStreamTest, SapType2WithNonkeyframePtsInEarlierRange) {}

TEST_F(SourceBufferStreamTest,
       MergeAllowedIfRangeEndTimeWithEstimatedDurationMatchesNextRangeStart) {}

}  // namespace media