OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/layers/video_layer_impl.h" | 5 #include "cc/layers/video_layer_impl.h" |
6 | 6 |
| 7 #include "cc/layers/video_frame_provider_client_impl.h" |
7 #include "cc/output/context_provider.h" | 8 #include "cc/output/context_provider.h" |
8 #include "cc/output/output_surface.h" | 9 #include "cc/output/output_surface.h" |
9 #include "cc/test/fake_video_frame_provider.h" | 10 #include "cc/test/fake_video_frame_provider.h" |
10 #include "cc/test/layer_test_common.h" | 11 #include "cc/test/layer_test_common.h" |
11 #include "cc/trees/single_thread_proxy.h" | 12 #include "cc/trees/single_thread_proxy.h" |
12 #include "media/base/video_frame.h" | 13 #include "media/base/video_frame.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 | 15 |
15 namespace cc { | 16 namespace cc { |
16 namespace { | 17 namespace { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 impl.quad_list(), | 70 impl.quad_list(), |
70 gfx::Rect(layer_size), | 71 gfx::Rect(layer_size), |
71 occluded, | 72 occluded, |
72 &partially_occluded_count); | 73 &partially_occluded_count); |
73 // The layer outputs one quad, which is partially occluded. | 74 // The layer outputs one quad, which is partially occluded. |
74 EXPECT_EQ(1u, impl.quad_list().size()); | 75 EXPECT_EQ(1u, impl.quad_list().size()); |
75 EXPECT_EQ(1u, partially_occluded_count); | 76 EXPECT_EQ(1u, partially_occluded_count); |
76 } | 77 } |
77 } | 78 } |
78 | 79 |
| 80 TEST(VideoLayerImplTest, DidBecomeActiveShouldSetActiveVideoLayer) { |
| 81 LayerTestCommon::LayerImplTest impl; |
| 82 DebugScopedSetImplThreadAndMainThreadBlocked thread(impl.proxy()); |
| 83 |
| 84 FakeVideoFrameProvider provider; |
| 85 VideoLayerImpl* video_layer_impl = |
| 86 impl.AddChildToRoot<VideoLayerImpl>(&provider); |
| 87 |
| 88 VideoFrameProviderClientImpl* client = |
| 89 static_cast<VideoFrameProviderClientImpl*>(provider.client()); |
| 90 ASSERT_TRUE(client); |
| 91 EXPECT_FALSE(client->active_video_layer()); |
| 92 |
| 93 video_layer_impl->DidBecomeActive(); |
| 94 EXPECT_EQ(video_layer_impl, client->active_video_layer()); |
| 95 } |
| 96 |
79 } // namespace | 97 } // namespace |
80 } // namespace cc | 98 } // namespace cc |
OLD | NEW |