| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "media/base/audio_decoder_config.h" | 7 #include "media/base/audio_decoder_config.h" |
| 8 #include "media/base/demuxer_stream.h" | 8 #include "media/base/demuxer_stream.h" |
| 9 #include "media/base/video_decoder_config.h" | 9 #include "media/base/video_decoder_config.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| 11 | 11 |
| 12 namespace media { | 12 namespace media { |
| 13 | 13 |
| 14 // Fake implementation of the DemuxerStream. These are the stream objects | 14 // Fake implementation of the DemuxerStream. These are the stream objects |
| 15 // we pass to the text renderer object when streams are added and removed. | 15 // we pass to the text renderer object when streams are added and removed. |
| 16 class FakeTextTrackStream : public DemuxerStream { | 16 class FakeTextTrackStream : public DemuxerStream { |
| 17 public: | 17 public: |
| 18 FakeTextTrackStream(); | 18 FakeTextTrackStream(); |
| 19 ~FakeTextTrackStream() override; | 19 ~FakeTextTrackStream() override; |
| 20 | 20 |
| 21 // DemuxerStream implementation. | 21 // DemuxerStream implementation. |
| 22 void Read(const ReadCB&) override; | 22 void Read(const ReadCB&) override; |
| 23 MOCK_METHOD0(audio_decoder_config, AudioDecoderConfig()); | 23 MOCK_METHOD0(audio_decoder_config, AudioDecoderConfig()); |
| 24 MOCK_METHOD0(video_decoder_config, VideoDecoderConfig()); | 24 MOCK_METHOD0(video_decoder_config, VideoDecoderConfig()); |
| 25 Type type() const override; | 25 Type type() const override; |
| 26 MOCK_METHOD0(EnableBitstreamConverter, void()); | 26 MOCK_METHOD0(EnableBitstreamConverter, void()); |
| 27 bool SupportsConfigChanges() override; | 27 bool SupportsConfigChanges() override; |
| 28 VideoRotation video_rotation() override; | 28 VideoRotation video_rotation() override; |
| 29 bool enabled() const override { return true; } |
| 30 void set_enabled(bool enabled, base::TimeDelta timestamp) override {} |
| 29 | 31 |
| 30 void SatisfyPendingRead(const base::TimeDelta& start, | 32 void SatisfyPendingRead(const base::TimeDelta& start, |
| 31 const base::TimeDelta& duration, | 33 const base::TimeDelta& duration, |
| 32 const std::string& id, | 34 const std::string& id, |
| 33 const std::string& content, | 35 const std::string& content, |
| 34 const std::string& settings); | 36 const std::string& settings); |
| 35 void AbortPendingRead(); | 37 void AbortPendingRead(); |
| 36 void SendEosNotification(); | 38 void SendEosNotification(); |
| 37 | 39 |
| 38 void Stop(); | 40 void Stop(); |
| 39 | 41 |
| 40 MOCK_METHOD0(OnRead, void()); | 42 MOCK_METHOD0(OnRead, void()); |
| 41 | 43 |
| 42 private: | 44 private: |
| 43 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 45 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 44 ReadCB read_cb_; | 46 ReadCB read_cb_; |
| 45 bool stopping_; | 47 bool stopping_; |
| 46 | 48 |
| 47 DISALLOW_COPY_AND_ASSIGN(FakeTextTrackStream); | 49 DISALLOW_COPY_AND_ASSIGN(FakeTextTrackStream); |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 } // namespace media | 52 } // namespace media |
| OLD | NEW |