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

Unified Diff: cc/resources/scoped_resource_unittest.cc

Issue 1154393003: cc: Use CheckedNumeric for resource size calculations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: initialize var Created 5 years, 6 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/tiles/tile.cc » ('j') | 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 73df3a6ae1b3ca731bc9275c98ba712fd54544ef..b37f09db4ab755ccfce93debb6bf748f532ad45c 100644
--- a/cc/resources/scoped_resource_unittest.cc
+++ b/cc/resources/scoped_resource_unittest.cc
@@ -32,7 +32,8 @@ TEST(ScopedResourceTest, NewScopedResource) {
// New scoped textures do not have a size yet.
EXPECT_EQ(gfx::Size(), texture->size());
- EXPECT_EQ(0u, texture->bytes());
+ EXPECT_EQ(0u, Resource::UncheckedMemorySizeBytes(texture->size(),
+ texture->format()));
}
TEST(ScopedResourceTest, CreateScopedResource) {
@@ -51,7 +52,8 @@ TEST(ScopedResourceTest, CreateScopedResource) {
// The texture has an allocated byte-size now.
size_t expected_bytes = 30 * 30 * 4;
- EXPECT_EQ(expected_bytes, texture->bytes());
+ EXPECT_EQ(expected_bytes, Resource::UncheckedMemorySizeBytes(
+ texture->size(), texture->format()));
EXPECT_LT(0u, texture->id());
EXPECT_EQ(static_cast<unsigned>(RGBA_8888), texture->format());
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/tiles/tile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698