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

Side by Side Diff: Source/platform/graphics/ImageFrameGeneratorTest.cpp

Issue 485833005: Image decoding: Remove deprecated image caching code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months 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 | Annotate | Revision Log
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 return info; 51 return info;
52 } 52 }
53 53
54 } // namespace 54 } // namespace
55 55
56 class ImageFrameGeneratorTest : public ::testing::Test, public MockImageDecoderC lient { 56 class ImageFrameGeneratorTest : public ::testing::Test, public MockImageDecoderC lient {
57 public: 57 public:
58 virtual void SetUp() OVERRIDE 58 virtual void SetUp() OVERRIDE
59 { 59 {
60 ImageDecodingStore::instance()->setCacheLimitInBytes(1024 * 1024); 60 ImageDecodingStore::instance()->setCacheLimitInBytes(1024 * 1024);
61 ImageDecodingStore::instance()->setImageCachingEnabled(true);
62 m_data = SharedBuffer::create(); 61 m_data = SharedBuffer::create();
63 m_generator = ImageFrameGenerator::create(fullSize(), m_data, false); 62 m_generator = ImageFrameGenerator::create(fullSize(), m_data, false);
64 useMockImageDecoderFactory(); 63 useMockImageDecoderFactory();
65 m_decodersDestroyed = 0; 64 m_decodersDestroyed = 0;
66 m_frameBufferRequestCount = 0; 65 m_frameBufferRequestCount = 0;
67 m_status = ImageFrame::FrameEmpty; 66 m_status = ImageFrame::FrameEmpty;
68 } 67 }
69 68
70 virtual void TearDown() OVERRIDE 69 virtual void TearDown() OVERRIDE
71 { 70 {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 static_cast<MockImageDecoder*>(tempDecoder)->setFrameHasAlpha(false); 194 static_cast<MockImageDecoder*>(tempDecoder)->setFrameHasAlpha(false);
196 ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), tempDecoder ); 195 ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), tempDecoder );
197 196
198 setFrameStatus(ImageFrame::FrameComplete); 197 setFrameStatus(ImageFrame::FrameComplete);
199 m_generator->decodeAndScale(imageInfo(), 1, buffer, 100 * 4); 198 m_generator->decodeAndScale(imageInfo(), 1, buffer, 100 * 4);
200 EXPECT_EQ(2, m_frameBufferRequestCount); 199 EXPECT_EQ(2, m_frameBufferRequestCount);
201 EXPECT_FALSE(m_generator->hasAlpha(1)); 200 EXPECT_FALSE(m_generator->hasAlpha(1));
202 } 201 }
203 202
204 } // namespace blink 203 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/ImageFrameGenerator.cpp ('k') | Source/platform/graphics/ScaledImageFragment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698