| OLD | NEW |
| 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 "media/base/mock_filters.h" | 5 #include "media/base/mock_filters.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "media/base/filter_host.h" | 9 #include "media/base/filter_host.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 if (buffered_bytes_ > 0) | 31 if (buffered_bytes_ > 0) |
| 32 host()->SetBufferedBytes(buffered_bytes_); | 32 host()->SetBufferedBytes(buffered_bytes_); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void MockDataSource::SetTotalAndBufferedBytes(int64 total_bytes, | 35 void MockDataSource::SetTotalAndBufferedBytes(int64 total_bytes, |
| 36 int64 buffered_bytes) { | 36 int64 buffered_bytes) { |
| 37 total_bytes_ = total_bytes; | 37 total_bytes_ = total_bytes; |
| 38 buffered_bytes_ = buffered_bytes; | 38 buffered_bytes_ = buffered_bytes; |
| 39 } | 39 } |
| 40 | 40 |
| 41 MockDemuxer::MockDemuxer() | 41 MockDemuxer::MockDemuxer() {} |
| 42 : total_bytes_(-1), buffered_bytes_(-1), duration_() { | |
| 43 EXPECT_CALL(*this, GetBitrate()).WillRepeatedly(Return(0)); | |
| 44 EXPECT_CALL(*this, IsLocalSource()).WillRepeatedly(Return(false)); | |
| 45 EXPECT_CALL(*this, IsSeekable()).WillRepeatedly(Return(false)); | |
| 46 } | |
| 47 | 42 |
| 48 MockDemuxer::~MockDemuxer() {} | 43 MockDemuxer::~MockDemuxer() {} |
| 49 | 44 |
| 50 void MockDemuxer::set_host(DemuxerHost* demuxer_host) { | |
| 51 Demuxer::set_host(demuxer_host); | |
| 52 | |
| 53 if (total_bytes_ > 0) | |
| 54 host()->SetTotalBytes(total_bytes_); | |
| 55 | |
| 56 if (buffered_bytes_ > 0) | |
| 57 host()->SetBufferedBytes(buffered_bytes_); | |
| 58 | |
| 59 if (duration_.InMilliseconds() > 0) | |
| 60 host()->SetDuration(duration_); | |
| 61 } | |
| 62 | |
| 63 void MockDemuxer::SetTotalAndBufferedBytesAndDuration( | |
| 64 int64 total_bytes, int64 buffered_bytes, const base::TimeDelta& duration) { | |
| 65 total_bytes_ = total_bytes; | |
| 66 buffered_bytes_ = buffered_bytes; | |
| 67 duration_ = duration; | |
| 68 } | |
| 69 | |
| 70 MockDemuxerStream::MockDemuxerStream() {} | 45 MockDemuxerStream::MockDemuxerStream() {} |
| 71 | 46 |
| 72 MockDemuxerStream::~MockDemuxerStream() {} | 47 MockDemuxerStream::~MockDemuxerStream() {} |
| 73 | 48 |
| 74 MockVideoDecoder::MockVideoDecoder() { | 49 MockVideoDecoder::MockVideoDecoder() { |
| 75 EXPECT_CALL(*this, HasAlpha()).WillRepeatedly(Return(false)); | 50 EXPECT_CALL(*this, HasAlpha()).WillRepeatedly(Return(false)); |
| 76 } | 51 } |
| 77 | 52 |
| 78 MockVideoDecoder::~MockVideoDecoder() {} | 53 MockVideoDecoder::~MockVideoDecoder() {} |
| 79 | 54 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 113 |
| 139 MockFilter::MockFilter() {} | 114 MockFilter::MockFilter() {} |
| 140 | 115 |
| 141 MockFilter::~MockFilter() {} | 116 MockFilter::~MockFilter() {} |
| 142 | 117 |
| 143 MockStatisticsCB::MockStatisticsCB() {} | 118 MockStatisticsCB::MockStatisticsCB() {} |
| 144 | 119 |
| 145 MockStatisticsCB::~MockStatisticsCB() {} | 120 MockStatisticsCB::~MockStatisticsCB() {} |
| 146 | 121 |
| 147 } // namespace media | 122 } // namespace media |
| OLD | NEW |