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

Side by Side Diff: media/filters/chunk_demuxer_unittest.cc

Issue 10451049: Track buffered byte ranges correctly in media::Pipeline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "media/base/audio_decoder_config.h" 6 #include "media/base/audio_decoder_config.h"
7 #include "media/base/mock_callback.h" 7 #include "media/base/mock_callback.h"
8 #include "media/base/mock_demuxer_host.h" 8 #include "media/base/mock_demuxer_host.h"
9 #include "media/base/test_data_util.h" 9 #include "media/base/test_data_util.h"
10 #include "media/filters/chunk_demuxer.h" 10 #include "media/filters/chunk_demuxer.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 ChunkDemuxer::Status AddId() { 177 ChunkDemuxer::Status AddId() {
178 std::vector<std::string> codecs(2); 178 std::vector<std::string> codecs(2);
179 codecs[0] = "vp8"; 179 codecs[0] = "vp8";
180 codecs[1] = "vorbis"; 180 codecs[1] = "vorbis";
181 return demuxer_->AddId(kSourceId, "video/webm", codecs); 181 return demuxer_->AddId(kSourceId, "video/webm", codecs);
182 } 182 }
183 183
184 bool AppendData(const uint8* data, size_t length) { 184 bool AppendData(const uint8* data, size_t length) {
185 CHECK(length); 185 CHECK(length);
186 EXPECT_CALL(host_, SetBufferedBytes(_)) 186 EXPECT_CALL(host_, AddBufferedByteRange(_, _)).Times(AnyNumber())
187 .Times(AnyNumber()) 187 .WillRepeatedly(SaveArg<1>(&buffered_bytes_));
188 .WillRepeatedly(SaveArg<0>(&buffered_bytes_));
189 EXPECT_CALL(host_, SetNetworkActivity(true)) 188 EXPECT_CALL(host_, SetNetworkActivity(true))
190 .Times(AnyNumber()); 189 .Times(AnyNumber());
191 return demuxer_->AppendData(kSourceId, data, length); 190 return demuxer_->AppendData(kSourceId, data, length);
192 } 191 }
193 192
194 bool AppendDataInPieces(const uint8* data, size_t length) { 193 bool AppendDataInPieces(const uint8* data, size_t length) {
195 return AppendDataInPieces(data, length, 7); 194 return AppendDataInPieces(data, length, 7);
196 } 195 }
197 196
198 bool AppendDataInPieces(const uint8* data, size_t length, size_t piece_size) { 197 bool AppendDataInPieces(const uint8* data, size_t length, size_t piece_size) {
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 1071
1073 std::vector<std::string> codecs(1); 1072 std::vector<std::string> codecs(1);
1074 codecs[0] = "vp8"; 1073 codecs[0] = "vp8";
1075 ASSERT_EQ(demuxer_->AddId(kSourceId, "video/webm", codecs), 1074 ASSERT_EQ(demuxer_->AddId(kSourceId, "video/webm", codecs),
1076 ChunkDemuxer::kOk); 1075 ChunkDemuxer::kOk);
1077 1076
1078 ASSERT_TRUE(AppendInfoTracks(true, true, false)); 1077 ASSERT_TRUE(AppendInfoTracks(true, true, false));
1079 } 1078 }
1080 1079
1081 } // namespace media 1080 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698