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 <deque> | 5 #include <deque> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 | 58 |
59 void CreateDemuxer(const std::string& name) { | 59 void CreateDemuxer(const std::string& name) { |
60 CreateDemuxer(name, false); | 60 CreateDemuxer(name, false); |
61 } | 61 } |
62 | 62 |
63 void CreateDemuxer(const std::string& name, bool disable_file_size) { | 63 void CreateDemuxer(const std::string& name, bool disable_file_size) { |
64 CHECK(!demuxer_); | 64 CHECK(!demuxer_); |
65 | 65 |
66 EXPECT_CALL(host_, SetTotalBytes(_)).Times(AnyNumber()); | 66 EXPECT_CALL(host_, SetTotalBytes(_)).Times(AnyNumber()); |
67 EXPECT_CALL(host_, SetBufferedBytes(_)).Times(AnyNumber()); | 67 EXPECT_CALL(host_, AddBufferedByteRange(_, _)).Times(AnyNumber()); |
68 EXPECT_CALL(host_, SetCurrentReadPosition(_)) | 68 EXPECT_CALL(host_, SetCurrentReadPosition(_)) |
69 .WillRepeatedly(SaveArg<0>(¤t_read_position_)); | 69 .WillRepeatedly(SaveArg<0>(¤t_read_position_)); |
70 | 70 |
71 CreateDataSource(name, disable_file_size); | 71 CreateDataSource(name, disable_file_size); |
72 demuxer_ = new FFmpegDemuxer(&message_loop_, data_source_); | 72 demuxer_ = new FFmpegDemuxer(&message_loop_, data_source_); |
73 } | 73 } |
74 | 74 |
75 MOCK_METHOD1(CheckPoint, void(int v)); | 75 MOCK_METHOD1(CheckPoint, void(int v)); |
76 | 76 |
77 void InitializeDemuxer() { | 77 void InitializeDemuxer() { |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 TEST_F(FFmpegDemuxerTest, UnsupportedVideoSupportedAudioDemux) { | 767 TEST_F(FFmpegDemuxerTest, UnsupportedVideoSupportedAudioDemux) { |
768 CreateDemuxer("vorbis_audio_wmv_video.mkv"); | 768 CreateDemuxer("vorbis_audio_wmv_video.mkv"); |
769 InitializeDemuxer(); | 769 InitializeDemuxer(); |
770 | 770 |
771 // Ensure the expected streams are present. | 771 // Ensure the expected streams are present. |
772 EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::VIDEO)); | 772 EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::VIDEO)); |
773 EXPECT_TRUE(demuxer_->GetStream(DemuxerStream::AUDIO)); | 773 EXPECT_TRUE(demuxer_->GetStream(DemuxerStream::AUDIO)); |
774 } | 774 } |
775 | 775 |
776 } // namespace media | 776 } // namespace media |
OLD | NEW |