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 <algorithm> | 5 #include <algorithm> |
6 #include <deque> | 6 #include <deque> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 void CreateDemuxer(const std::string& name) { | 60 void CreateDemuxer(const std::string& name) { |
61 CreateDemuxer(name, false); | 61 CreateDemuxer(name, false); |
62 } | 62 } |
63 | 63 |
64 void CreateDemuxer(const std::string& name, bool disable_file_size) { | 64 void CreateDemuxer(const std::string& name, bool disable_file_size) { |
65 CHECK(!demuxer_); | 65 CHECK(!demuxer_); |
66 | 66 |
67 EXPECT_CALL(host_, SetTotalBytes(_)).Times(AnyNumber()); | 67 EXPECT_CALL(host_, SetTotalBytes(_)).Times(AnyNumber()); |
68 EXPECT_CALL(host_, AddBufferedByteRange(_, _)).Times(AnyNumber()); | 68 EXPECT_CALL(host_, AddBufferedByteRange(_, _)).Times(AnyNumber()); |
69 EXPECT_CALL(host_, AddBufferedTimeRange(_, _)).Times(AnyNumber()); | |
70 | 69 |
71 CreateDataSource(name, disable_file_size); | 70 CreateDataSource(name, disable_file_size); |
72 demuxer_ = new FFmpegDemuxer(&message_loop_, data_source_); | 71 demuxer_ = new FFmpegDemuxer(&message_loop_, data_source_); |
73 } | 72 } |
74 | 73 |
75 MOCK_METHOD1(CheckPoint, void(int v)); | 74 MOCK_METHOD1(CheckPoint, void(int v)); |
76 | 75 |
77 void InitializeDemuxer() { | 76 void InitializeDemuxer() { |
78 EXPECT_CALL(host_, SetDuration(_)); | 77 EXPECT_CALL(host_, SetDuration(_)); |
79 demuxer_->Initialize(&host_, NewExpectedStatusCB(PIPELINE_OK)); | 78 demuxer_->Initialize(&host_, NewExpectedStatusCB(PIPELINE_OK)); |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 TEST_F(FFmpegDemuxerTest, UnsupportedVideoSupportedAudioDemux) { | 773 TEST_F(FFmpegDemuxerTest, UnsupportedVideoSupportedAudioDemux) { |
775 CreateDemuxer("vorbis_audio_wmv_video.mkv"); | 774 CreateDemuxer("vorbis_audio_wmv_video.mkv"); |
776 InitializeDemuxer(); | 775 InitializeDemuxer(); |
777 | 776 |
778 // Ensure the expected streams are present. | 777 // Ensure the expected streams are present. |
779 EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::VIDEO)); | 778 EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::VIDEO)); |
780 EXPECT_TRUE(demuxer_->GetStream(DemuxerStream::AUDIO)); | 779 EXPECT_TRUE(demuxer_->GetStream(DemuxerStream::AUDIO)); |
781 } | 780 } |
782 | 781 |
783 } // namespace media | 782 } // namespace media |
OLD | NEW |