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

Unified Diff: cc/resources/scoped_resource_unittest.cc

Issue 2697353003: cc: Make ScopedResource constructor public, use MakeUnique to construct (Closed)
Patch Set: construct: . Created 3 years, 10 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/scoped_resource.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/scoped_resource_unittest.cc
diff --git a/cc/resources/scoped_resource_unittest.cc b/cc/resources/scoped_resource_unittest.cc
index 3fe2f326f6f16c0d33a6ba900fad98dd0f44e7b3..b3f713411cac48fbb150df01a5a62226d29d3915 100644
--- a/cc/resources/scoped_resource_unittest.cc
+++ b/cc/resources/scoped_resource_unittest.cc
@@ -24,8 +24,7 @@ TEST(ScopedResourceTest, NewScopedResource) {
std::unique_ptr<ResourceProvider> resource_provider =
FakeResourceProvider::Create(context_provider.get(),
shared_bitmap_manager.get());
- std::unique_ptr<ScopedResource> texture =
- ScopedResource::Create(resource_provider.get());
+ auto texture = base::MakeUnique<ScopedResource>(resource_provider.get());
// New scoped textures do not hold a texture yet.
EXPECT_EQ(0u, texture->id());
@@ -46,8 +45,7 @@ TEST(ScopedResourceTest, CreateScopedResource) {
std::unique_ptr<ResourceProvider> resource_provider =
FakeResourceProvider::Create(context_provider.get(),
shared_bitmap_manager.get());
- std::unique_ptr<ScopedResource> texture =
- ScopedResource::Create(resource_provider.get());
+ auto texture = base::MakeUnique<ScopedResource>(resource_provider.get());
texture->Allocate(gfx::Size(30, 30), ResourceProvider::TEXTURE_HINT_IMMUTABLE,
RGBA_8888, gfx::ColorSpace());
@@ -72,8 +70,7 @@ TEST(ScopedResourceTest, ScopedResourceIsDeleted) {
FakeResourceProvider::Create(context_provider.get(),
shared_bitmap_manager.get());
{
- std::unique_ptr<ScopedResource> texture =
- ScopedResource::Create(resource_provider.get());
+ auto texture = base::MakeUnique<ScopedResource>(resource_provider.get());
EXPECT_EQ(0u, resource_provider->num_resources());
texture->Allocate(gfx::Size(30, 30),
@@ -85,8 +82,7 @@ TEST(ScopedResourceTest, ScopedResourceIsDeleted) {
EXPECT_EQ(0u, resource_provider->num_resources());
{
- std::unique_ptr<ScopedResource> texture =
- ScopedResource::Create(resource_provider.get());
+ auto texture = base::MakeUnique<ScopedResource>(resource_provider.get());
EXPECT_EQ(0u, resource_provider->num_resources());
texture->Allocate(gfx::Size(30, 30),
ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888,
« no previous file with comments | « cc/resources/scoped_resource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698