OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/output/compositor_frame.h" | 5 #include "cc/output/compositor_frame.h" |
6 #include "cc/output/delegated_frame_data.h" | 6 #include "cc/output/delegated_frame_data.h" |
7 #include "cc/surfaces/surface.h" | 7 #include "cc/surfaces/surface.h" |
8 #include "cc/surfaces/surface_factory.h" | 8 #include "cc/surfaces/surface_factory.h" |
9 #include "cc/surfaces/surface_factory_client.h" | 9 #include "cc/surfaces/surface_factory_client.h" |
10 #include "cc/surfaces/surface_manager.h" | 10 #include "cc/surfaces/surface_manager.h" |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 { | 349 { |
350 SCOPED_TRACE("fourth frame, second unref"); | 350 SCOPED_TRACE("fourth frame, second unref"); |
351 ResourceProvider::ResourceId expected_returned_ids[] = {12, 13}; | 351 ResourceProvider::ResourceId expected_returned_ids[] = {12, 13}; |
352 int expected_returned_counts[] = {2, 2}; | 352 int expected_returned_counts[] = {2, 2}; |
353 CheckReturnedResourcesMatchExpected(expected_returned_ids, | 353 CheckReturnedResourcesMatchExpected(expected_returned_ids, |
354 expected_returned_counts, | 354 expected_returned_counts, |
355 arraysize(expected_returned_counts)); | 355 arraysize(expected_returned_counts)); |
356 } | 356 } |
357 } | 357 } |
358 | 358 |
| 359 // Tests shutting down the factory with a surface with outstanding refs still in |
| 360 // the map. |
| 361 TEST_F(SurfaceFactoryTest, DestroyWithResourceRefs) { |
| 362 SurfaceId id(7); |
| 363 factory_.Create(id, gfx::Size(1, 1)); |
| 364 |
| 365 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); |
| 366 TransferableResource resource; |
| 367 resource.id = 1; |
| 368 resource.mailbox_holder.texture_target = GL_TEXTURE_2D; |
| 369 frame_data->resource_list.push_back(resource); |
| 370 scoped_ptr<CompositorFrame> frame(new CompositorFrame); |
| 371 frame->delegated_frame_data = frame_data.Pass(); |
| 372 factory_.SubmitFrame(id, frame.Pass(), base::Closure()); |
| 373 } |
| 374 |
359 } // namespace | 375 } // namespace |
360 } // namespace cc | 376 } // namespace cc |
OLD | NEW |