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 19 matching lines...) Expand all Loading... |
30 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
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 = ImageFrameGenerator::create(SkISize::Make(100, 100), true); | 40 m_generator = |
| 41 ImageFrameGenerator::create(SkISize::Make(100, 100), nullptr, true); |
41 m_decodersDestroyed = 0; | 42 m_decodersDestroyed = 0; |
42 } | 43 } |
43 | 44 |
44 void TearDown() override { ImageDecodingStore::instance().clear(); } | 45 void TearDown() override { ImageDecodingStore::instance().clear(); } |
45 | 46 |
46 void decoderBeingDestroyed() override { ++m_decodersDestroyed; } | 47 void decoderBeingDestroyed() override { ++m_decodersDestroyed; } |
47 | 48 |
48 void decodeRequested() override { | 49 void decodeRequested() override { |
49 // Decoder is never used by ImageDecodingStore. | 50 // Decoder is never used by ImageDecodingStore. |
50 ASSERT_TRUE(false); | 51 ASSERT_TRUE(false); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 EXPECT_TRUE(testDecoder); | 167 EXPECT_TRUE(testDecoder); |
167 EXPECT_EQ(refDecoder, testDecoder); | 168 EXPECT_EQ(refDecoder, testDecoder); |
168 ImageDecodingStore::instance().removeDecoder(m_generator.get(), testDecoder); | 169 ImageDecodingStore::instance().removeDecoder(m_generator.get(), testDecoder); |
169 EXPECT_FALSE(ImageDecodingStore::instance().cacheEntries()); | 170 EXPECT_FALSE(ImageDecodingStore::instance().cacheEntries()); |
170 | 171 |
171 EXPECT_FALSE(ImageDecodingStore::instance().lockDecoder(m_generator.get(), | 172 EXPECT_FALSE(ImageDecodingStore::instance().lockDecoder(m_generator.get(), |
172 size, &testDecoder)); | 173 size, &testDecoder)); |
173 } | 174 } |
174 | 175 |
175 } // namespace blink | 176 } // namespace blink |
OLD | NEW |