Index: third_party/WebKit/Source/core/loader/resource/MockImageResourceClient.h |
diff --git a/third_party/WebKit/Source/core/loader/resource/MockImageResourceClient.h b/third_party/WebKit/Source/core/loader/resource/MockImageResourceClient.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ecbc913097b6beebd8887e72c70ef4eaf29adfd6 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/loader/resource/MockImageResourceClient.h |
@@ -0,0 +1,50 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MockImageResourceClient_h |
+#define MockImageResourceClient_h |
+ |
+#include "core/loader/resource/ImageResource.h" |
+#include "core/loader/resource/ImageResourceContent.h" |
+#include "core/loader/resource/ImageResourceObserver.h" |
+#include "platform/loader/fetch/MockResourceClient.h" |
+ |
+namespace blink { |
+ |
+class MockImageResourceClient final : public MockResourceClient, |
+ public ImageResourceObserver { |
+ public: |
+ explicit MockImageResourceClient(ImageResource*); |
+ ~MockImageResourceClient() override; |
+ |
+ void imageNotifyFinished(ImageResourceContent*) override; |
+ void imageChanged(ImageResourceContent*, const IntRect*) override; |
+ |
+ String debugName() const override { return "MockImageResourceClient"; } |
+ |
+ bool notifyFinishedCalled() const override; |
+ |
+ void removeAsClient() override; |
+ void dispose() override; |
+ |
+ int imageChangedCount() const { return m_imageChangedCount; } |
+ int imageNotifyFinishedCount() const { return m_imageNotifyFinishedCount; } |
+ |
+ size_t encodedSizeOnLastImageChanged() const { |
+ return m_encodedSizeOnLastImageChanged; |
+ } |
+ size_t encodedSizeOnImageNotifyFinished() const { |
+ return m_encodedSizeOnImageNotifyFinished; |
+ } |
+ |
+ private: |
+ int m_imageChangedCount; |
+ size_t m_encodedSizeOnLastImageChanged; |
+ int m_imageNotifyFinishedCount; |
+ size_t m_encodedSizeOnImageNotifyFinished; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // MockImageResourceClient_h |