| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> |
| 6 |
| 5 #include "base/logging.h" | 7 #include "base/logging.h" |
| 6 #include "cc/resources/resource_util.h" | 8 #include "cc/resources/resource_util.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 10 |
| 9 namespace cc { | 11 namespace cc { |
| 10 namespace { | 12 namespace { |
| 11 | 13 |
| 12 struct TestFormat { | 14 struct TestFormat { |
| 13 ResourceFormat format; | 15 ResourceFormat format; |
| 14 size_t expected_bytes; | 16 size_t expected_bytes; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 160 |
| 159 TEST_F(ResourceUtilTest, SizeInBytesOverflow) { | 161 TEST_F(ResourceUtilTest, SizeInBytesOverflow) { |
| 160 gfx::Size size(10, 10); | 162 gfx::Size size(10, 10); |
| 161 // 10 * 16 * 10 = 1600 bits, overflows in char, but fits in int. | 163 // 10 * 16 * 10 = 1600 bits, overflows in char, but fits in int. |
| 162 EXPECT_FALSE(ResourceUtil::VerifySizeInBytes<signed char>(size, RGBA_4444)); | 164 EXPECT_FALSE(ResourceUtil::VerifySizeInBytes<signed char>(size, RGBA_4444)); |
| 163 EXPECT_TRUE(ResourceUtil::VerifySizeInBytes<int>(size, RGBA_4444)); | 165 EXPECT_TRUE(ResourceUtil::VerifySizeInBytes<int>(size, RGBA_4444)); |
| 164 } | 166 } |
| 165 | 167 |
| 166 } // namespace | 168 } // namespace |
| 167 } // namespace cc | 169 } // namespace cc |
| OLD | NEW |