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

Unified Diff: cc/surfaces/surface_factory_unittest.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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_factory.cc ('k') | cc/surfaces/surface_resource_holder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_factory_unittest.cc
diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc
index 9ec949297a6bdbf4bc0a4710fb00f62f0fcdc5e4..2f917d7853923e68907bc27af5c31fddf2ef54a7 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -491,6 +491,30 @@ TEST_F(SurfaceFactoryTest, DestroyAll) {
EXPECT_EQ(1u, execute_count);
}
+// Tests that SurfaceFactory doesn't return resources after Reset().
+TEST_F(SurfaceFactoryTest, Reset) {
+ LocalFrameId id(7, 0);
+ factory_->Create(id);
+
+ TransferableResource resource;
+ resource.id = 1;
+ resource.mailbox_holder.texture_target = GL_TEXTURE_2D;
+ CompositorFrame frame;
+ frame.resource_list.push_back(resource);
+ uint32_t execute_count = 0;
+ factory_->SubmitCompositorFrame(id, std::move(frame),
+ base::Bind(&DrawCallback, &execute_count));
+ EXPECT_EQ(last_created_surface_id().local_frame_id(), id);
+
+ SurfaceId surface_id(kArbitraryFrameSinkId, id);
+ manager_.AddSurfaceReference(SurfaceManager::kRootSurfaceId, surface_id);
+ factory_->Reset();
+ EXPECT_TRUE(client_.returned_resources().empty());
+ manager_.RemoveSurfaceReference(SurfaceManager::kRootSurfaceId, surface_id);
+ EXPECT_TRUE(client_.returned_resources().empty());
+ local_frame_id_ = LocalFrameId();
+}
+
TEST_F(SurfaceFactoryTest, DestroySequence) {
LocalFrameId local_frame_id2(5, 0);
SurfaceId id2(kArbitraryFrameSinkId, local_frame_id2);
« no previous file with comments | « cc/surfaces/surface_factory.cc ('k') | cc/surfaces/surface_resource_holder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698