| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 76 } |
| 77 | 77 |
| 78 void CreateDemuxer(const std::string& name, bool disable_file_size) { | 78 void CreateDemuxer(const std::string& name, bool disable_file_size) { |
| 79 CHECK(!demuxer_); | 79 CHECK(!demuxer_); |
| 80 | 80 |
| 81 EXPECT_CALL(host_, SetTotalBytes(_)).Times(AnyNumber()); | 81 EXPECT_CALL(host_, SetTotalBytes(_)).Times(AnyNumber()); |
| 82 EXPECT_CALL(host_, AddBufferedByteRange(_, _)).Times(AnyNumber()); | 82 EXPECT_CALL(host_, AddBufferedByteRange(_, _)).Times(AnyNumber()); |
| 83 EXPECT_CALL(host_, AddBufferedTimeRange(_, _)).Times(AnyNumber()); | 83 EXPECT_CALL(host_, AddBufferedTimeRange(_, _)).Times(AnyNumber()); |
| 84 | 84 |
| 85 CreateDataSource(name, disable_file_size); | 85 CreateDataSource(name, disable_file_size); |
| 86 demuxer_ = new FFmpegDemuxer(&message_loop_, data_source_); | 86 demuxer_ = new FFmpegDemuxer(message_loop_.message_loop_proxy(), |
| 87 data_source_); |
| 87 } | 88 } |
| 88 | 89 |
| 89 MOCK_METHOD1(CheckPoint, void(int v)); | 90 MOCK_METHOD1(CheckPoint, void(int v)); |
| 90 | 91 |
| 91 void InitializeDemuxer() { | 92 void InitializeDemuxer() { |
| 92 EXPECT_CALL(host_, SetDuration(_)); | 93 EXPECT_CALL(host_, SetDuration(_)); |
| 93 demuxer_->Initialize(&host_, NewExpectedStatusCB(PIPELINE_OK)); | 94 demuxer_->Initialize(&host_, NewExpectedStatusCB(PIPELINE_OK)); |
| 94 message_loop_.RunAllPending(); | 95 message_loop_.RunAllPending(); |
| 95 } | 96 } |
| 96 | 97 |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 TEST_F(FFmpegDemuxerTest, UnsupportedVideoSupportedAudioDemux) { | 691 TEST_F(FFmpegDemuxerTest, UnsupportedVideoSupportedAudioDemux) { |
| 691 CreateDemuxer("vorbis_audio_wmv_video.mkv"); | 692 CreateDemuxer("vorbis_audio_wmv_video.mkv"); |
| 692 InitializeDemuxer(); | 693 InitializeDemuxer(); |
| 693 | 694 |
| 694 // Ensure the expected streams are present. | 695 // Ensure the expected streams are present. |
| 695 EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::VIDEO)); | 696 EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::VIDEO)); |
| 696 EXPECT_TRUE(demuxer_->GetStream(DemuxerStream::AUDIO)); | 697 EXPECT_TRUE(demuxer_->GetStream(DemuxerStream::AUDIO)); |
| 697 } | 698 } |
| 698 | 699 |
| 699 } // namespace media | 700 } // namespace media |
| OLD | NEW |