Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(711)

Side by Side Diff: media/test/pipeline_integration_test_base.h

Issue 1053113002: Prime the landing pad for the new video rendering pipeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cast. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/test/pipeline_integration_test.cc ('k') | media/test/pipeline_integration_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ 5 #ifndef MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_
6 #define MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ 6 #define MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_
7 7
8 #include "base/md5.h" 8 #include "base/md5.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "media/audio/clockless_audio_sink.h" 10 #include "media/audio/clockless_audio_sink.h"
(...skipping 27 matching lines...) Expand all
38 class DummyTickClock : public base::TickClock { 38 class DummyTickClock : public base::TickClock {
39 public: 39 public:
40 DummyTickClock() : now_() {} 40 DummyTickClock() : now_() {}
41 ~DummyTickClock() override {} 41 ~DummyTickClock() override {}
42 base::TimeTicks NowTicks() override; 42 base::TimeTicks NowTicks() override;
43 43
44 private: 44 private:
45 base::TimeTicks now_; 45 base::TimeTicks now_;
46 }; 46 };
47 47
48 // TODO(dalecurtis): Mocks won't be useful for the new rendering path, we'll
49 // need fake callback generators like we have for the audio path.
50 // http://crbug.com/473424
51 class MockVideoRendererSink : public VideoRendererSink {
52 public:
53 MockVideoRendererSink();
54 ~MockVideoRendererSink() override;
55
56 MOCK_METHOD1(Start, void(VideoRendererSink::RenderCallback*));
57 MOCK_METHOD0(Stop, void());
58 MOCK_METHOD1(PaintFrameUsingOldRenderingPath,
59 void(const scoped_refptr<VideoFrame>&));
60 };
61
48 // Integration tests for Pipeline. Real demuxers, real decoders, and 62 // Integration tests for Pipeline. Real demuxers, real decoders, and
49 // base renderer implementations are used to verify pipeline functionality. The 63 // base renderer implementations are used to verify pipeline functionality. The
50 // renderers used in these tests rely heavily on the AudioRendererBase & 64 // renderers used in these tests rely heavily on the AudioRendererBase &
51 // VideoRendererImpl implementations which contain a majority of the code used 65 // VideoRendererImpl implementations which contain a majority of the code used
52 // in the real AudioRendererImpl & SkCanvasVideoRenderer implementations used in 66 // in the real AudioRendererImpl & SkCanvasVideoRenderer implementations used in
53 // the browser. The renderers in this test don't actually write data to a 67 // the browser. The renderers in this test don't actually write data to a
54 // display or audio device. Both of these devices are simulated since they have 68 // display or audio device. Both of these devices are simulated since they have
55 // little effect on verifying pipeline behavior and allow tests to run faster 69 // little effect on verifying pipeline behavior and allow tests to run faster
56 // than real-time. 70 // than real-time.
57 class PipelineIntegrationTestBase { 71 class PipelineIntegrationTestBase {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 protected: 112 protected:
99 base::MessageLoop message_loop_; 113 base::MessageLoop message_loop_;
100 base::MD5Context md5_context_; 114 base::MD5Context md5_context_;
101 bool hashing_enabled_; 115 bool hashing_enabled_;
102 bool clockless_playback_; 116 bool clockless_playback_;
103 scoped_ptr<Demuxer> demuxer_; 117 scoped_ptr<Demuxer> demuxer_;
104 scoped_ptr<DataSource> data_source_; 118 scoped_ptr<DataSource> data_source_;
105 scoped_ptr<Pipeline> pipeline_; 119 scoped_ptr<Pipeline> pipeline_;
106 scoped_refptr<NullAudioSink> audio_sink_; 120 scoped_refptr<NullAudioSink> audio_sink_;
107 scoped_refptr<ClocklessAudioSink> clockless_audio_sink_; 121 scoped_refptr<ClocklessAudioSink> clockless_audio_sink_;
122 testing::NiceMock<MockVideoRendererSink> video_sink_;
108 bool ended_; 123 bool ended_;
109 PipelineStatus pipeline_status_; 124 PipelineStatus pipeline_status_;
110 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; 125 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_;
111 VideoFrame::Format last_video_frame_format_; 126 VideoFrame::Format last_video_frame_format_;
112 DummyTickClock dummy_clock_; 127 DummyTickClock dummy_clock_;
113 AudioHardwareConfig hardware_config_; 128 AudioHardwareConfig hardware_config_;
114 PipelineMetadata metadata_; 129 PipelineMetadata metadata_;
115 130
116 void OnSeeked(base::TimeDelta seek_time, PipelineStatus status); 131 void OnSeeked(base::TimeDelta seek_time, PipelineStatus status);
117 void OnStatusCallback(PipelineStatus status); 132 void OnStatusCallback(PipelineStatus status);
(...skipping 21 matching lines...) Expand all
139 MOCK_METHOD1(DecryptorAttached, void(bool)); 154 MOCK_METHOD1(DecryptorAttached, void(bool));
140 MOCK_METHOD2(OnAddTextTrack, 155 MOCK_METHOD2(OnAddTextTrack,
141 void(const TextTrackConfig& config, 156 void(const TextTrackConfig& config,
142 const AddTextTrackDoneCB& done_cb)); 157 const AddTextTrackDoneCB& done_cb));
143 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); 158 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void));
144 }; 159 };
145 160
146 } // namespace media 161 } // namespace media
147 162
148 #endif // MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_ 163 #endif // MEDIA_TEST_PIPELINE_INTEGRATION_TEST_BASE_H_
OLDNEW
« no previous file with comments | « media/test/pipeline_integration_test.cc ('k') | media/test/pipeline_integration_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698