OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MockImageResourceClient_h |
| 6 #define MockImageResourceClient_h |
| 7 |
| 8 #include "core/loader/resource/ImageResource.h" |
| 9 #include "core/loader/resource/ImageResourceContent.h" |
| 10 #include "core/loader/resource/ImageResourceObserver.h" |
| 11 #include "platform/loader/fetch/MockResourceClient.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class MockImageResourceClient final : public MockResourceClient, |
| 16 public ImageResourceObserver { |
| 17 public: |
| 18 explicit MockImageResourceClient(ImageResource*); |
| 19 ~MockImageResourceClient() override; |
| 20 |
| 21 void imageNotifyFinished(ImageResourceContent*) override; |
| 22 void imageChanged(ImageResourceContent*, const IntRect*) override; |
| 23 |
| 24 String debugName() const override { return "MockImageResourceClient"; } |
| 25 |
| 26 bool notifyFinishedCalled() const override; |
| 27 |
| 28 void removeAsClient() override; |
| 29 void dispose() override; |
| 30 |
| 31 int imageChangedCount() const { return m_imageChangedCount; } |
| 32 int imageNotifyFinishedCount() const { return m_imageNotifyFinishedCount; } |
| 33 |
| 34 size_t encodedSizeOnLastImageChanged() const { |
| 35 return m_encodedSizeOnLastImageChanged; |
| 36 } |
| 37 size_t encodedSizeOnImageNotifyFinished() const { |
| 38 return m_encodedSizeOnImageNotifyFinished; |
| 39 } |
| 40 |
| 41 private: |
| 42 int m_imageChangedCount; |
| 43 size_t m_encodedSizeOnLastImageChanged; |
| 44 int m_imageNotifyFinishedCount; |
| 45 size_t m_encodedSizeOnImageNotifyFinished; |
| 46 }; |
| 47 |
| 48 } // namespace blink |
| 49 |
| 50 #endif // MockImageResourceClient_h |
OLD | NEW |