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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h

Issue 1962563002: Fix ImageDecoder::frameIsCompleteAtIndex - fully received instead of decoded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 String filenameExtension() const override 85 String filenameExtension() const override
86 { 86 {
87 return "mock"; 87 return "mock";
88 } 88 }
89 89
90 int repetitionCount() const override 90 int repetitionCount() const override
91 { 91 {
92 return m_client->repetitionCount(); 92 return m_client->repetitionCount();
93 } 93 }
94 94
95 bool frameIsCompleteAtIndex(size_t) const override 95 bool frameIsFullyReceivedAtIndex(size_t index) const override
96 { 96 {
97 return m_client->status() == ImageFrame::FrameComplete; 97 // All but the last frame are fully received.
98 // For the last frame use base class implementation.
99 if (index < m_frameBufferCache.size() - 1)
100 return true;
101 return ImageDecoder::frameIsFullyReceivedAtIndex(index);
98 } 102 }
99 103
100 float frameDurationAtIndex(size_t) const override 104 float frameDurationAtIndex(size_t) const override
101 { 105 {
102 return m_client->frameDuration(); 106 return m_client->frameDuration();
103 } 107 }
104 108
105 size_t clearCacheExceptFrame(size_t clearExceptFrame) override 109 size_t clearCacheExceptFrame(size_t clearExceptFrame) override
106 { 110 {
107 m_client->clearCacheExceptFrameRequested(clearExceptFrame); 111 m_client->clearCacheExceptFrameRequested(clearExceptFrame);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 { 165 {
162 } 166 }
163 167
164 MockImageDecoderClient* m_client; 168 MockImageDecoderClient* m_client;
165 IntSize m_decodedSize; 169 IntSize m_decodedSize;
166 }; 170 };
167 171
168 } // namespace blink 172 } // namespace blink
169 173
170 #endif // MockImageDecoder_h 174 #endif // MockImageDecoder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698