OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include <memory> | 31 #include <memory> |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class ImageDecodingStoreTest : public ::testing::Test, | 35 class ImageDecodingStoreTest : public ::testing::Test, |
36 public MockImageDecoderClient { | 36 public MockImageDecoderClient { |
37 public: | 37 public: |
38 void SetUp() override { | 38 void SetUp() override { |
39 ImageDecodingStore::instance().setCacheLimitInBytes(1024 * 1024); | 39 ImageDecodingStore::instance().setCacheLimitInBytes(1024 * 1024); |
40 m_generator = | 40 m_generator = |
41 ImageFrameGenerator::create(SkISize::Make(100, 100), nullptr, true); | 41 ImageFrameGenerator::create(SkISize::Make(100, 100), true, |
| 42 ImageDecoder::ColorSpaceIgnored, nullptr); |
42 m_decodersDestroyed = 0; | 43 m_decodersDestroyed = 0; |
43 } | 44 } |
44 | 45 |
45 void TearDown() override { ImageDecodingStore::instance().clear(); } | 46 void TearDown() override { ImageDecodingStore::instance().clear(); } |
46 | 47 |
47 void decoderBeingDestroyed() override { ++m_decodersDestroyed; } | 48 void decoderBeingDestroyed() override { ++m_decodersDestroyed; } |
48 | 49 |
49 void decodeRequested() override { | 50 void decodeRequested() override { |
50 // Decoder is never used by ImageDecodingStore. | 51 // Decoder is never used by ImageDecodingStore. |
51 ASSERT_TRUE(false); | 52 ASSERT_TRUE(false); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 EXPECT_TRUE(testDecoder); | 168 EXPECT_TRUE(testDecoder); |
168 EXPECT_EQ(refDecoder, testDecoder); | 169 EXPECT_EQ(refDecoder, testDecoder); |
169 ImageDecodingStore::instance().removeDecoder(m_generator.get(), testDecoder); | 170 ImageDecodingStore::instance().removeDecoder(m_generator.get(), testDecoder); |
170 EXPECT_FALSE(ImageDecodingStore::instance().cacheEntries()); | 171 EXPECT_FALSE(ImageDecodingStore::instance().cacheEntries()); |
171 | 172 |
172 EXPECT_FALSE(ImageDecodingStore::instance().lockDecoder(m_generator.get(), | 173 EXPECT_FALSE(ImageDecodingStore::instance().lockDecoder(m_generator.get(), |
173 size, &testDecoder)); | 174 size, &testDecoder)); |
174 } | 175 } |
175 | 176 |
176 } // namespace blink | 177 } // namespace blink |
OLD | NEW |