Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1138)

Unified Diff: cc/surfaces/surface_synchronization_unittest.cc

Issue 2940183002: cc: Move ownership of surfaces to SurfaceManager (Closed)
Patch Set: Fix exo Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/surface_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_synchronization_unittest.cc
diff --git a/cc/surfaces/surface_synchronization_unittest.cc b/cc/surfaces/surface_synchronization_unittest.cc
index c9983d75642d7f8627255a1983af8ccd31bd4139..6fc69e6ef9dacc424c57f0c65e0d8a4515d3aa99 100644
--- a/cc/surfaces/surface_synchronization_unittest.cc
+++ b/cc/surfaces/surface_synchronization_unittest.cc
@@ -76,27 +76,27 @@ class SurfaceSynchronizationTest : public testing::Test {
CompositorFrameSinkSupport& display_support() { return *supports_[0]; }
Surface* display_surface() {
- return display_support().current_surface_for_testing();
+ return display_support().GetCurrentSurfaceForTesting();
}
CompositorFrameSinkSupport& parent_support() { return *supports_[1]; }
Surface* parent_surface() {
- return parent_support().current_surface_for_testing();
+ return parent_support().GetCurrentSurfaceForTesting();
}
CompositorFrameSinkSupport& child_support1() { return *supports_[2]; }
Surface* child_surface1() {
- return child_support1().current_surface_for_testing();
+ return child_support1().GetCurrentSurfaceForTesting();
}
CompositorFrameSinkSupport& child_support2() { return *supports_[3]; }
Surface* child_surface2() {
- return child_support2().current_surface_for_testing();
+ return child_support2().GetCurrentSurfaceForTesting();
}
CompositorFrameSinkSupport& support(int index) { return *supports_[index]; }
Surface* surface(int index) {
- return support(index).current_surface_for_testing();
+ return support(index).GetCurrentSurfaceForTesting();
}
SurfaceManager& surface_manager() { return surface_manager_; }
@@ -177,6 +177,10 @@ class SurfaceSynchronizationTest : public testing::Test {
surface_observer_.Reset();
}
+ bool IsMarkedForDestruction(const SurfaceId& surface_id) {
+ return surface_manager_.IsMarkedForDestruction(surface_id);
+ }
+
protected:
testing::NiceMock<MockCompositorFrameSinkSupportClient> support_client_;
@@ -1041,7 +1045,7 @@ TEST_F(SurfaceSynchronizationTest, SurfaceResurrection) {
child_support1().EvictCurrentSurface();
surface = surface_manager().GetSurfaceForId(child_id);
EXPECT_NE(nullptr, surface);
- EXPECT_TRUE(surface->destroyed());
+ EXPECT_TRUE(IsMarkedForDestruction(child_id));
// Child submits another frame to the same local surface id that is marked
// destroyed.
@@ -1052,7 +1056,7 @@ TEST_F(SurfaceSynchronizationTest, SurfaceResurrection) {
// used again.
Surface* surface2 = surface_manager().GetSurfaceForId(child_id);
EXPECT_EQ(surface, surface2);
- EXPECT_FALSE(surface2->destroyed());
+ EXPECT_FALSE(IsMarkedForDestruction(child_id));
}
// Verifies that if a LocalSurfaceId belonged to a surface that doesn't exist
« no previous file with comments | « cc/surfaces/surface_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698