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

Side by Side Diff: trunk/src/cc/resources/scoped_resource_unittest.cc

Issue 13316003: Revert 191364 "cc: Add ‘chromium_code’: 1 to cc.gyp and cc_t..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/cc/resources/scoped_resource.cc ('k') | trunk/src/cc/resources/tile_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/resources/scoped_resource.h" 5 #include "cc/resources/scoped_resource.h"
6 6
7 #include "cc/output/renderer.h" 7 #include "cc/output/renderer.h"
8 #include "cc/test/fake_output_surface.h" 8 #include "cc/test/fake_output_surface.h"
9 #include "cc/test/tiled_layer_test_common.h" 9 #include "cc/test/tiled_layer_test_common.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 24 matching lines...) Expand all
35 scoped_ptr<ScopedResource> texture = 35 scoped_ptr<ScopedResource> texture =
36 ScopedResource::create(resource_provider.get()); 36 ScopedResource::create(resource_provider.get());
37 texture->Allocate( 37 texture->Allocate(
38 gfx::Size(30, 30), GL_RGBA, ResourceProvider::TextureUsageAny); 38 gfx::Size(30, 30), GL_RGBA, ResourceProvider::TextureUsageAny);
39 39
40 // The texture has an allocated byte-size now. 40 // The texture has an allocated byte-size now.
41 size_t expected_bytes = 30 * 30 * 4; 41 size_t expected_bytes = 30 * 30 * 4;
42 EXPECT_EQ(expected_bytes, texture->bytes()); 42 EXPECT_EQ(expected_bytes, texture->bytes());
43 43
44 EXPECT_LT(0u, texture->id()); 44 EXPECT_LT(0u, texture->id());
45 EXPECT_EQ(static_cast<unsigned>(GL_RGBA), texture->format()); 45 EXPECT_EQ(GL_RGBA, texture->format());
46 EXPECT_EQ(gfx::Size(30, 30), texture->size()); 46 EXPECT_EQ(gfx::Size(30, 30), texture->size());
47 } 47 }
48 48
49 TEST(ScopedResourceTest, ScopedResourceIsDeleted) { 49 TEST(ScopedResourceTest, ScopedResourceIsDeleted) {
50 scoped_ptr<OutputSurface> context(CreateFakeOutputSurface()); 50 scoped_ptr<OutputSurface> context(CreateFakeOutputSurface());
51 scoped_ptr<ResourceProvider> resource_provider( 51 scoped_ptr<ResourceProvider> resource_provider(
52 ResourceProvider::Create(context.get())); 52 ResourceProvider::Create(context.get()));
53 { 53 {
54 scoped_ptr<ScopedResource> texture = 54 scoped_ptr<ScopedResource> texture =
55 ScopedResource::create(resource_provider.get()); 55 ScopedResource::create(resource_provider.get());
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 texture->Free(); 96 texture->Free();
97 EXPECT_EQ(0u, texture->id()); 97 EXPECT_EQ(0u, texture->id());
98 EXPECT_EQ(1u, resource_provider->num_resources()); 98 EXPECT_EQ(1u, resource_provider->num_resources());
99 } 99 }
100 100
101 EXPECT_EQ(1u, resource_provider->num_resources()); 101 EXPECT_EQ(1u, resource_provider->num_resources());
102 } 102 }
103 103
104 } // namespace 104 } // namespace
105 } // namespace cc 105 } // namespace cc
OLDNEW
« no previous file with comments | « trunk/src/cc/resources/scoped_resource.cc ('k') | trunk/src/cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698