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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp

Issue 2523943002: Explicitly specify target color space to ImageDecoder at creation (Closed)
Patch Set: Rebase Created 4 years 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698