OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "media/base/factory.h" | 7 #include "media/base/factory.h" |
8 #include "media/base/filter_host.h" | 8 #include "media/base/filter_host.h" |
9 #include "media/base/filters.h" | 9 #include "media/base/filters.h" |
10 #include "media/base/media_format.h" | 10 #include "media/base/media_format.h" |
11 #include "media/base/mock_media_filters.h" | 11 #include "media/base/mock_media_filters.h" |
12 #include "media/base/pipeline_impl.h" | 12 #include "media/base/pipeline_impl.h" |
13 #include "media/filters/test_video_decoder.h" | 13 #include "media/filters/test_video_decoder.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 using media::FilterFactoryCollection; | 16 using media::FilterFactoryCollection; |
17 using media::InstanceFilterFactory; | 17 using media::InstanceFilterFactory; |
18 using media::MockAudioDecoder; | |
19 using media::MockAudioRenderer; | |
20 using media::MockDataSource; | |
21 using media::MockDemuxer; | |
22 using media::MockFilterConfig; | |
23 using media::MockFilterFactory; | |
24 using media::MockVideoRenderer; | |
25 using media::PipelineImpl; | 18 using media::PipelineImpl; |
26 using media::TestVideoDecoder; | 19 using media::TestVideoDecoder; |
27 using media::VideoFrame; | 20 using media::old_mocks::InitializationHelper; |
| 21 using media::old_mocks::MockFilterConfig; |
| 22 using media::old_mocks::MockFilterFactory; |
28 | 23 |
29 TEST(VideoDecoder, CreateTestDecoder) { | 24 TEST(VideoDecoder, CreateTestDecoder) { |
30 std::string url(""); | 25 std::string url(""); |
31 PipelineImpl p; | 26 PipelineImpl p; |
32 scoped_refptr<TestVideoDecoder> test_decoder = new TestVideoDecoder(); | 27 scoped_refptr<TestVideoDecoder> test_decoder = new TestVideoDecoder(); |
33 MockFilterConfig config; | 28 MockFilterConfig config; |
34 scoped_refptr<FilterFactoryCollection> c = new FilterFactoryCollection(); | 29 scoped_refptr<FilterFactoryCollection> c = new FilterFactoryCollection(); |
35 c->AddFactory(new InstanceFilterFactory<TestVideoDecoder>(test_decoder)); | 30 c->AddFactory(new InstanceFilterFactory<TestVideoDecoder>(test_decoder)); |
36 c->AddFactory(new MockFilterFactory(&config)); | 31 c->AddFactory(new MockFilterFactory(&config)); |
37 media::InitializationHelper h; | 32 InitializationHelper h; |
38 h.Start(&p, c, url); | 33 h.Start(&p, c, url); |
39 p.SetPlaybackRate(1.0f); | 34 p.SetPlaybackRate(1.0f); |
40 p.Stop(); | 35 p.Stop(); |
41 } | 36 } |
OLD | NEW |