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

Unified Diff: cc/resources/resource_provider_unittest.cc

Issue 23023005: cc: refcount resources as we send them to the parent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 4 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/resources/resource_provider.cc ('k') | cc/trees/layer_tree_host_unittest_delegated.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider_unittest.cc
diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc
index ad6b3d36f2a2d2d04e884c74ba540768a0136725..5bff9a2a0c7ede698f177458b24a48bbfad165c4 100644
--- a/cc/resources/resource_provider_unittest.cc
+++ b/cc/resources/resource_provider_unittest.cc
@@ -579,13 +579,18 @@ TEST_P(ResourceProviderTest, TransferResources) {
EXPECT_EQ(0, memcmp(data2, result, pixel_size));
{
// Check that transfering again the same resource from the child to the
- // parent is a noop.
+ // parent works.
ResourceProvider::ResourceIdArray resource_ids_to_transfer;
resource_ids_to_transfer.push_back(id1);
TransferableResourceArray list;
child_resource_provider->PrepareSendToParent(resource_ids_to_transfer,
&list);
- EXPECT_EQ(0u, list.size());
+ EXPECT_EQ(1u, list.size());
+ EXPECT_EQ(id1, list[0].id);
+ child_resource_provider->ReceiveFromParent(list);
+ // id1 was exported twice, we returned it only once, it should still be
+ // in-use.
+ EXPECT_TRUE(child_resource_provider->InUseByConsumer(id1));
}
{
// Transfer resources back from the parent to the child.
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/trees/layer_tree_host_unittest_delegated.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698