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

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

Issue 10535101: Replace Pipeline::SetNetworkActivity() with BufferedDataSource -> WebMediaPlayerImpl callback. (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
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/decoder_buffer.h" 7 #include "media/base/decoder_buffer.h"
8 #include "media/base/mock_callback.h" 8 #include "media/base/mock_callback.h"
9 #include "media/base/mock_demuxer_host.h" 9 #include "media/base/mock_demuxer_host.h"
10 #include "media/base/test_data_util.h" 10 #include "media/base/test_data_util.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 std::vector<std::string> codecs(2); 200 std::vector<std::string> codecs(2);
201 codecs[0] = "vp8"; 201 codecs[0] = "vp8";
202 codecs[1] = "vorbis"; 202 codecs[1] = "vorbis";
203 return demuxer_->AddId(kSourceId, "video/webm", codecs); 203 return demuxer_->AddId(kSourceId, "video/webm", codecs);
204 } 204 }
205 205
206 bool AppendData(const uint8* data, size_t length) { 206 bool AppendData(const uint8* data, size_t length) {
207 CHECK(length); 207 CHECK(length);
208 EXPECT_CALL(host_, AddBufferedByteRange(_, _)).Times(AnyNumber()) 208 EXPECT_CALL(host_, AddBufferedByteRange(_, _)).Times(AnyNumber())
209 .WillRepeatedly(SaveArg<1>(&buffered_bytes_)); 209 .WillRepeatedly(SaveArg<1>(&buffered_bytes_));
210 EXPECT_CALL(host_, SetNetworkActivity(true))
211 .Times(AnyNumber());
212 return demuxer_->AppendData(kSourceId, data, length); 210 return demuxer_->AppendData(kSourceId, data, length);
213 } 211 }
214 212
215 bool AppendDataInPieces(const uint8* data, size_t length) { 213 bool AppendDataInPieces(const uint8* data, size_t length) {
216 return AppendDataInPieces(data, length, 7); 214 return AppendDataInPieces(data, length, 7);
217 } 215 }
218 216
219 bool AppendDataInPieces(const uint8* data, size_t length, size_t piece_size) { 217 bool AppendDataInPieces(const uint8* data, size_t length, size_t piece_size) {
220 const uint8* start = data; 218 const uint8* start = data;
221 const uint8* end = data + length; 219 const uint8* end = data + length;
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 // Append another identical initialization segment. 1130 // Append another identical initialization segment.
1133 ASSERT_TRUE(AppendInitSegment(true, true, false)); 1131 ASSERT_TRUE(AppendInitSegment(true, true, false));
1134 1132
1135 scoped_ptr<Cluster> cluster_b(kDefaultSecondCluster()); 1133 scoped_ptr<Cluster> cluster_b(kDefaultSecondCluster());
1136 ASSERT_TRUE(AppendData(cluster_b->data(), cluster_b->size())); 1134 ASSERT_TRUE(AppendData(cluster_b->data(), cluster_b->size()));
1137 1135
1138 GenerateExpectedReads(0, 9, audio, video); 1136 GenerateExpectedReads(0, 9, audio, video);
1139 } 1137 }
1140 1138
1141 } // namespace media 1139 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698