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

Unified Diff: cc/surfaces/surface_factory_unittest.cc

Issue 693943003: Update from https://crrev.com/302630 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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/test/test_gpu_memory_buffer_manager.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 4e0865a23876e01d439e430d413e8ffbf7524ada..e36636c5f1c28438777e7c536bae4c5b887be2df 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -42,7 +42,10 @@ class SurfaceFactoryTest : public testing::Test {
factory_.Create(surface_id_, gfx::Size(5, 5));
}
- virtual ~SurfaceFactoryTest() { factory_.Destroy(surface_id_); }
+ virtual ~SurfaceFactoryTest() {
+ if (!surface_id_.is_null())
+ factory_.Destroy(surface_id_);
+ }
void SubmitFrameWithResources(ResourceProvider::ResourceId* resource_ids,
size_t num_resource_ids) {
@@ -355,9 +358,8 @@ TEST_F(SurfaceFactoryTest, ResourceLifetime) {
}
}
-// Tests shutting down the factory with a surface with outstanding refs still in
-// the map.
-TEST_F(SurfaceFactoryTest, DestroyWithResourceRefs) {
+// Tests doing a DestroyAll before shutting down the factory;
+TEST_F(SurfaceFactoryTest, DestroyAll) {
SurfaceId id(7);
factory_.Create(id, gfx::Size(1, 1));
@@ -369,6 +371,9 @@ TEST_F(SurfaceFactoryTest, DestroyWithResourceRefs) {
scoped_ptr<CompositorFrame> frame(new CompositorFrame);
frame->delegated_frame_data = frame_data.Pass();
factory_.SubmitFrame(id, frame.Pass(), base::Closure());
+
+ surface_id_ = SurfaceId();
+ factory_.DestroyAll();
}
TEST_F(SurfaceFactoryTest, DestroySequence) {
« no previous file with comments | « cc/surfaces/surface_factory.cc ('k') | cc/test/test_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698