| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 < const_cast<MockImageDecoder*>(this)->frameCount() - 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 Loading... |
| 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 |
| OLD | NEW |