Chromium Code Reviews| Index: cc/tiles/software_image_decode_cache_unittest.cc |
| diff --git a/cc/tiles/software_image_decode_cache_unittest.cc b/cc/tiles/software_image_decode_cache_unittest.cc |
| index 8df5b9c8746b4f43d07df17d7a5a7c1ac8e69db9..ec3f0a98d6e46218927ab2885bd0ba9733779633 100644 |
| --- a/cc/tiles/software_image_decode_cache_unittest.cc |
| +++ b/cc/tiles/software_image_decode_cache_unittest.cc |
| @@ -1446,5 +1446,28 @@ TEST(SoftwareImageDecodeCacheTest, |
| cache.UnrefImage(draw_image_49); |
| } |
| +TEST(SoftwareImageDecodeCacheTest, ClearCache) { |
| + TestSoftwareImageDecodeCache cache; |
| + bool is_decomposable = true; |
| + SkFilterQuality quality = kHigh_SkFilterQuality; |
| + |
| + for (int i = 0; i < 10; ++i) { |
| + sk_sp<SkImage> image = CreateImage(100, 100); |
| + DrawImage draw_image( |
| + image, SkIRect::MakeWH(image->width(), image->height()), quality, |
| + CreateMatrix(SkSize::Make(1.0f, 1.0f), is_decomposable)); |
| + scoped_refptr<TileTask> task; |
| + bool need_unref = cache.GetTaskForImageAndRef( |
| + draw_image, ImageDecodeCache::TracingInfo(), &task); |
| + EXPECT_TRUE(need_unref); |
| + EXPECT_TRUE(task); |
| + TestTileTaskRunner::ProcessTask(task.get()); |
| + cache.UnrefImage(draw_image); |
| + } |
| + |
| + // Tell our cache to clear resources. |
| + cache.ClearCache(); |
|
vmpstr
2017/04/04 00:43:17
Is there anything we can query to check if the cac
ericrk
2017/04/04 17:17:18
yup - meant to ask you if you were OK with adding
|
| +} |
| + |
| } // namespace |
| } // namespace cc |