| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/filters/source_buffer_state.h" | 5 #include "media/filters/source_buffer_state.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 void(ChunkDemuxerStream*, const TextTrackConfig&)); | 121 void(ChunkDemuxerStream*, const TextTrackConfig&)); |
| 122 | 122 |
| 123 MOCK_METHOD1(MediaTracksUpdatedMock, void(std::unique_ptr<MediaTracks>&)); | 123 MOCK_METHOD1(MediaTracksUpdatedMock, void(std::unique_ptr<MediaTracks>&)); |
| 124 void OnMediaTracksUpdated(std::unique_ptr<MediaTracks> tracks) { | 124 void OnMediaTracksUpdated(std::unique_ptr<MediaTracks> tracks) { |
| 125 MediaTracksUpdatedMock(tracks); | 125 MediaTracksUpdatedMock(tracks); |
| 126 } | 126 } |
| 127 | 127 |
| 128 ChunkDemuxerStream* CreateDemuxerStream(DemuxerStream::Type type) { | 128 ChunkDemuxerStream* CreateDemuxerStream(DemuxerStream::Type type) { |
| 129 static unsigned track_id = 0; | 129 static unsigned track_id = 0; |
| 130 demuxer_streams_.push_back(base::WrapUnique( | 130 demuxer_streams_.push_back(base::WrapUnique( |
| 131 new ChunkDemuxerStream(type, false, base::UintToString(++track_id)))); | 131 new ChunkDemuxerStream(type, base::UintToString(++track_id)))); |
| 132 return demuxer_streams_.back().get(); | 132 return demuxer_streams_.back().get(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 scoped_refptr<testing::StrictMock<MockMediaLog>> media_log_; | 135 scoped_refptr<testing::StrictMock<MockMediaLog>> media_log_; |
| 136 std::vector<std::unique_ptr<ChunkDemuxerStream>> demuxer_streams_; | 136 std::vector<std::unique_ptr<ChunkDemuxerStream>> demuxer_streams_; |
| 137 MockStreamParser* mock_stream_parser_; | 137 MockStreamParser* mock_stream_parser_; |
| 138 StreamParser::NewConfigCB new_config_cb_; | 138 StreamParser::NewConfigCB new_config_cb_; |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 TEST_F(SourceBufferStateTest, InitSingleAudioTrack) { | 141 TEST_F(SourceBufferStateTest, InitSingleAudioTrack) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 // Emulate the situation where bytestream track ids have changed in the third | 303 // Emulate the situation where bytestream track ids have changed in the third |
| 304 // init segment. This must cause failure in the OnNewConfigs. | 304 // init segment. This must cause failure in the OnNewConfigs. |
| 305 std::unique_ptr<MediaTracks> tracks3(new MediaTracks()); | 305 std::unique_ptr<MediaTracks> tracks3(new MediaTracks()); |
| 306 AddVideoTrack(tracks3, kCodecVP8, 1); | 306 AddVideoTrack(tracks3, kCodecVP8, 1); |
| 307 AddVideoTrack(tracks3, kCodecVP9, 3); | 307 AddVideoTrack(tracks3, kCodecVP9, 3); |
| 308 EXPECT_MEDIA_LOG(UnexpectedTrack("video", "3")); | 308 EXPECT_MEDIA_LOG(UnexpectedTrack("video", "3")); |
| 309 EXPECT_FALSE(AppendDataAndReportTracks(sbs, std::move(tracks3))); | 309 EXPECT_FALSE(AppendDataAndReportTracks(sbs, std::move(tracks3))); |
| 310 } | 310 } |
| 311 | 311 |
| 312 } // namespace media | 312 } // namespace media |
| OLD | NEW |