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

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

Issue 2556723003: Merge color options into ColorBehavior (Closed)
Patch Set: Feedback 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 19 matching lines...) Expand all
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 = 40 m_generator = ImageFrameGenerator::create(SkISize::Make(100, 100), true,
41 ImageFrameGenerator::create(SkISize::Make(100, 100), true, 41 ColorBehavior::ignore());
42 ImageDecoder::ColorSpaceIgnored, nullptr);
43 m_decodersDestroyed = 0; 42 m_decodersDestroyed = 0;
44 } 43 }
45 44
46 void TearDown() override { ImageDecodingStore::instance().clear(); } 45 void TearDown() override { ImageDecodingStore::instance().clear(); }
47 46
48 void decoderBeingDestroyed() override { ++m_decodersDestroyed; } 47 void decoderBeingDestroyed() override { ++m_decodersDestroyed; }
49 48
50 void decodeRequested() override { 49 void decodeRequested() override {
51 // Decoder is never used by ImageDecodingStore. 50 // Decoder is never used by ImageDecodingStore.
52 ASSERT_TRUE(false); 51 ASSERT_TRUE(false);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 EXPECT_TRUE(testDecoder); 167 EXPECT_TRUE(testDecoder);
169 EXPECT_EQ(refDecoder, testDecoder); 168 EXPECT_EQ(refDecoder, testDecoder);
170 ImageDecodingStore::instance().removeDecoder(m_generator.get(), testDecoder); 169 ImageDecodingStore::instance().removeDecoder(m_generator.get(), testDecoder);
171 EXPECT_FALSE(ImageDecodingStore::instance().cacheEntries()); 170 EXPECT_FALSE(ImageDecodingStore::instance().cacheEntries());
172 171
173 EXPECT_FALSE(ImageDecodingStore::instance().lockDecoder(m_generator.get(), 172 EXPECT_FALSE(ImageDecodingStore::instance().lockDecoder(m_generator.get(),
174 size, &testDecoder)); 173 size, &testDecoder));
175 } 174 }
176 175
177 } // namespace blink 176 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698