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 "media/base/factory.h" | 5 #include "media/base/factory.h" |
6 #include "media/base/filters.h" | 6 #include "media/base/filters.h" |
7 #include "media/base/mock_media_filters.h" | 7 #include "media/base/mock_media_filters.h" |
8 #include "media/base/mock_filter_host.h" | 8 #include "media/base/mock_filter_host.h" |
9 #include "media/filters/test_video_renderer.h" | 9 #include "media/filters/test_video_renderer.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 using media::FilterFactory; | |
13 using media::MockFilterConfig; | |
14 using media::MockFilterHost; | 12 using media::MockFilterHost; |
15 using media::MockPipeline; | 13 using media::MockPipeline; |
16 using media::MockVideoDecoder; | |
17 using media::TestVideoRenderer; | 14 using media::TestVideoRenderer; |
| 15 using media::old_mocks::MockFilterConfig; |
| 16 using media::old_mocks::MockVideoDecoder; |
18 | 17 |
19 TEST(VideoRenderer, CreateAndPlay) { | 18 TEST(VideoRenderer, CreateAndPlay) { |
20 // Prepare test data. | 19 // Prepare test data. |
21 MockFilterConfig config; | 20 MockFilterConfig config; |
22 scoped_refptr<MockVideoDecoder> decoder = new MockVideoDecoder(&config); | 21 scoped_refptr<MockVideoDecoder> decoder = new MockVideoDecoder(&config); |
23 scoped_refptr<TestVideoRenderer> renderer = new TestVideoRenderer(); | 22 scoped_refptr<TestVideoRenderer> renderer = new TestVideoRenderer(); |
24 | 23 |
25 // Setup our mock pipeline. | 24 // Setup our mock pipeline. |
26 MockPipeline pipeline; | 25 MockPipeline pipeline; |
27 MockFilterHost<MockVideoDecoder> filter_host_a(&pipeline, decoder); | 26 MockFilterHost<MockVideoDecoder> filter_host_a(&pipeline, decoder); |
(...skipping 20 matching lines...) Expand all Loading... |
48 pipeline.SetTime(previous_time); | 47 pipeline.SetTime(previous_time); |
49 filter_host_b.GetTimeUpdateCallback()->Run(previous_time); | 48 filter_host_b.GetTimeUpdateCallback()->Run(previous_time); |
50 pipeline.RunAllTasks(); | 49 pipeline.RunAllTasks(); |
51 | 50 |
52 // Renderer should have scheduled a new callback time and painted a frame. | 51 // Renderer should have scheduled a new callback time and painted a frame. |
53 EXPECT_GT(filter_host_b.GetScheduledCallbackTime().InMicroseconds(), | 52 EXPECT_GT(filter_host_b.GetScheduledCallbackTime().InMicroseconds(), |
54 previous_time.InMicroseconds()); | 53 previous_time.InMicroseconds()); |
55 EXPECT_EQ(previous_unique_frames + 1, renderer->unique_frames()); | 54 EXPECT_EQ(previous_unique_frames + 1, renderer->unique_frames()); |
56 } | 55 } |
57 } | 56 } |
OLD | NEW |