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 "cc/surfaces/direct_compositor_frame_sink.h" | 5 #include "cc/surfaces/direct_compositor_frame_sink.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "cc/output/renderer_settings.h" | 10 #include "cc/output/renderer_settings.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 131 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
132 SwapBuffersWithDamage(display_rect_); | 132 SwapBuffersWithDamage(display_rect_); |
133 task_runner_->RunUntilIdle(); | 133 task_runner_->RunUntilIdle(); |
134 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 134 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
135 display_output_surface_->set_suspended_for_recycle(false); | 135 display_output_surface_->set_suspended_for_recycle(false); |
136 SwapBuffersWithDamage(display_rect_); | 136 SwapBuffersWithDamage(display_rect_); |
137 task_runner_->RunUntilIdle(); | 137 task_runner_->RunUntilIdle(); |
138 EXPECT_EQ(2u, display_output_surface_->num_sent_frames()); | 138 EXPECT_EQ(2u, display_output_surface_->num_sent_frames()); |
139 } | 139 } |
140 | 140 |
141 TEST_F(DirectCompositorFrameSinkTest, | |
142 LockingResourcesDoesNotIndirectlyCauseDamage) { | |
143 compositor_frame_sink_->ForceReclaimResources(); | |
144 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | |
145 task_runner_->RunPendingTasks(); | |
146 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | |
147 | |
148 SwapBuffersWithDamage(gfx::Rect()); | |
149 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | |
150 task_runner_->RunUntilIdle(); | |
151 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | |
152 } | |
153 | |
154 } // namespace | 141 } // namespace |
155 } // namespace cc | 142 } // namespace cc |
OLD | NEW |