| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 String filenameExtension() const override | 70 String filenameExtension() const override |
| 71 { | 71 { |
| 72 return "mock"; | 72 return "mock"; |
| 73 } | 73 } |
| 74 | 74 |
| 75 int repetitionCount() const override | 75 int repetitionCount() const override |
| 76 { | 76 { |
| 77 return m_client->repetitionCount(); | 77 return m_client->repetitionCount(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool frameIsCompleteAtIndex(size_t) const override | 80 bool frameIsFullyReceivedAtIndex(size_t index) const override |
| 81 { | 81 { |
| 82 return m_client->status() == ImageFrame::FrameComplete; | 82 // All but the last frame are fully received. |
| 83 // For the last frame use bse class implementation. |
| 84 if (index < const_cast<MockImageDecoder*>(this)->frameCount() - 1) |
| 85 return true; |
| 86 return ImageDecoder::frameIsFullyReceivedAtIndex(index); |
| 83 } | 87 } |
| 84 | 88 |
| 85 float frameDurationAtIndex(size_t) const override | 89 float frameDurationAtIndex(size_t) const override |
| 86 { | 90 { |
| 87 return m_client->frameDuration(); | 91 return m_client->frameDuration(); |
| 88 } | 92 } |
| 89 | 93 |
| 90 size_t clearCacheExceptFrame(size_t clearExceptFrame) override | 94 size_t clearCacheExceptFrame(size_t clearExceptFrame) override |
| 91 { | 95 { |
| 92 m_client->clearCacheExceptFrameRequested(clearExceptFrame); | 96 m_client->clearCacheExceptFrameRequested(clearExceptFrame); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 { | 143 { |
| 140 } | 144 } |
| 141 | 145 |
| 142 MockImageDecoderClient* m_client; | 146 MockImageDecoderClient* m_client; |
| 143 IntSize m_decodedSize; | 147 IntSize m_decodedSize; |
| 144 }; | 148 }; |
| 145 | 149 |
| 146 } // namespace blink | 150 } // namespace blink |
| 147 | 151 |
| 148 #endif // MockImageDecoder_h | 152 #endif // MockImageDecoder_h |
| OLD | NEW |