Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "cc/layers/video_frame_provider_client_impl.h" | 6 #include "cc/layers/video_frame_provider_client_impl.h" |
| 7 #include "cc/layers/video_layer_impl.h" | 7 #include "cc/layers/video_layer_impl.h" |
| 8 #include "cc/output/begin_frame_args.h" | 8 #include "cc/output/begin_frame_args.h" |
| 9 #include "cc/test/fake_video_frame_provider.h" | 9 #include "cc/test/fake_video_frame_provider.h" |
| 10 #include "cc/test/layer_test_common.h" | 10 #include "cc/test/layer_test_common.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 DISALLOW_COPY_AND_ASSIGN(VideoFrameProviderClientImplTest); | 97 DISALLOW_COPY_AND_ASSIGN(VideoFrameProviderClientImplTest); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 TEST_F(VideoFrameProviderClientImplTest, StartStopRendering) { | 100 TEST_F(VideoFrameProviderClientImplTest, StartStopRendering) { |
| 101 StartRendering(); | 101 StartRendering(); |
| 102 StopRendering(); | 102 StopRendering(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 TEST_F(VideoFrameProviderClientImplTest, StopRenderingUpdateDamage) { | |
| 106 CreateActiveVideoLayer(); | |
| 107 StartRendering(); | |
| 108 EXPECT_EQ(gfx::Rect(), video_layer_impl_->update_rect()); | |
| 109 StopRendering(); | |
|
danakj
2017/02/01 17:52:09
Can you also stop before start and see no damage h
qiangchen
2017/02/01 18:51:59
That does not work, because in StopRendering there
| |
| 110 EXPECT_NE(gfx::Rect(), video_layer_impl_->update_rect()); | |
| 111 } | |
| 112 | |
| 105 TEST_F(VideoFrameProviderClientImplTest, StopUsingProvider) { | 113 TEST_F(VideoFrameProviderClientImplTest, StopUsingProvider) { |
| 106 ASSERT_TRUE(client_impl_->get_provider_for_testing()); | 114 ASSERT_TRUE(client_impl_->get_provider_for_testing()); |
| 107 StartRendering(); | 115 StartRendering(); |
| 108 EXPECT_CALL(*this, RemoveVideoFrameController(_)); | 116 EXPECT_CALL(*this, RemoveVideoFrameController(_)); |
| 109 client_impl_->StopUsingProvider(); | 117 client_impl_->StopUsingProvider(); |
| 110 ASSERT_FALSE(client_impl_->get_provider_for_testing()); | 118 ASSERT_FALSE(client_impl_->get_provider_for_testing()); |
| 111 } | 119 } |
| 112 | 120 |
| 113 TEST_F(VideoFrameProviderClientImplTest, FrameAcquisition) { | 121 TEST_F(VideoFrameProviderClientImplTest, FrameAcquisition) { |
| 114 CreateActiveVideoLayer(); | 122 CreateActiveVideoLayer(); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 134 TEST_F(VideoFrameProviderClientImplTest, DidDrawFrameIssuesPutCurrentFrame) { | 142 TEST_F(VideoFrameProviderClientImplTest, DidDrawFrameIssuesPutCurrentFrame) { |
| 135 CreateActiveVideoLayer(); | 143 CreateActiveVideoLayer(); |
| 136 StartRenderingAndRenderFrame(); | 144 StartRenderingAndRenderFrame(); |
| 137 EXPECT_EQ(0, provider_.put_current_frame_count()); | 145 EXPECT_EQ(0, provider_.put_current_frame_count()); |
| 138 client_impl_->DidDrawFrame(); | 146 client_impl_->DidDrawFrame(); |
| 139 EXPECT_EQ(1, provider_.put_current_frame_count()); | 147 EXPECT_EQ(1, provider_.put_current_frame_count()); |
| 140 StopRendering(); | 148 StopRendering(); |
| 141 } | 149 } |
| 142 | 150 |
| 143 } // namespace cc | 151 } // namespace cc |
| OLD | NEW |