OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/callback.h" | 7 #include "base/callback.h" |
8 #include "base/thread.h" | 8 #include "base/thread.h" |
9 #include "media/base/filters.h" | 9 #include "media/base/filters.h" |
10 #include "media/base/mock_ffmpeg.h" | 10 #include "media/base/mock_ffmpeg.h" |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 | 662 |
663 // A gmock helper method to execute the callback and deletes it. | 663 // A gmock helper method to execute the callback and deletes it. |
664 void RunCallback(size_t size, DataSource::ReadCallback* callback) { | 664 void RunCallback(size_t size, DataSource::ReadCallback* callback) { |
665 DCHECK(callback); | 665 DCHECK(callback); |
666 callback->RunWithParams(Tuple1<size_t>(size)); | 666 callback->RunWithParams(Tuple1<size_t>(size)); |
667 delete callback; | 667 delete callback; |
668 } | 668 } |
669 | 669 |
670 TEST_F(FFmpegDemuxerTest, ProtocolRead) { | 670 TEST_F(FFmpegDemuxerTest, ProtocolRead) { |
671 // Creates a demuxer. | 671 // Creates a demuxer. |
672 scoped_refptr<MockFFmpegDemuxer> demuxer = new MockFFmpegDemuxer(); | 672 scoped_refptr<MockFFmpegDemuxer> demuxer(new MockFFmpegDemuxer()); |
673 ASSERT_TRUE(demuxer); | 673 ASSERT_TRUE(demuxer); |
674 demuxer->set_host(&host_); | 674 demuxer->set_host(&host_); |
675 demuxer->set_message_loop(&message_loop_); | 675 demuxer->set_message_loop(&message_loop_); |
676 demuxer->data_source_ = data_source_; | 676 demuxer->data_source_ = data_source_; |
677 | 677 |
678 uint8 kBuffer[1]; | 678 uint8 kBuffer[1]; |
679 InSequence s; | 679 InSequence s; |
680 // Actions taken in the first read. | 680 // Actions taken in the first read. |
681 EXPECT_CALL(*data_source_, GetSize(_)) | 681 EXPECT_CALL(*data_source_, GetSize(_)) |
682 .WillOnce(DoAll(SetArgumentPointee<0>(1024), Return(true))); | 682 .WillOnce(DoAll(SetArgumentPointee<0>(1024), Return(true))); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 { | 767 { |
768 SCOPED_TRACE(""); | 768 SCOPED_TRACE(""); |
769 InitializeDemuxer(); | 769 InitializeDemuxer(); |
770 } | 770 } |
771 EXPECT_CALL(*data_source_, IsStreaming()) | 771 EXPECT_CALL(*data_source_, IsStreaming()) |
772 .WillOnce(Return(false)); | 772 .WillOnce(Return(false)); |
773 EXPECT_FALSE(demuxer_->IsStreaming()); | 773 EXPECT_FALSE(demuxer_->IsStreaming()); |
774 } | 774 } |
775 | 775 |
776 } // namespace media | 776 } // namespace media |
OLD | NEW |