Index: third_party/WebKit/Source/core/fetch/MockResourceClients.h |
diff --git a/third_party/WebKit/Source/core/fetch/MockResourceClients.h b/third_party/WebKit/Source/core/fetch/MockResourceClients.h |
index f5a6313c81af8c16740fc0b35c9dc3581e35827d..000f58d6ad36c905e8f4cf95f70823e119e9981c 100644 |
--- a/third_party/WebKit/Source/core/fetch/MockResourceClients.h |
+++ b/third_party/WebKit/Source/core/fetch/MockResourceClients.h |
@@ -31,6 +31,7 @@ |
#ifndef MockResourceClients_h |
#define MockResourceClients_h |
+#include "core/fetch/FontResource.h" |
#include "core/fetch/ImageResourceObserver.h" |
#include "core/fetch/Resource.h" |
#include "core/fetch/ResourceClient.h" |
@@ -98,6 +99,42 @@ class MockImageResourceClient final : public MockResourceClient, |
size_t m_encodedSizeOnImageNotifyFinished; |
}; |
+class MockFontResourceClient final |
+ : public GarbageCollectedFinalized<MockFontResourceClient>, |
+ public FontResourceClient { |
+ USING_PRE_FINALIZER(MockFontResourceClient, dispose); |
+ USING_GARBAGE_COLLECTED_MIXIN(MockFontResourceClient); |
+ |
+ public: |
+ explicit MockFontResourceClient(Resource*); |
+ ~MockFontResourceClient() override; |
+ |
+ void fontLoadShortLimitExceeded(FontResource*) override; |
+ void fontLoadLongLimitExceeded(FontResource*) override; |
+ |
+ bool fontLoadShortLimitExceededCalled() const { |
+ return m_fontLoadShortLimitExceededCalled; |
+ } |
+ |
+ bool fontLoadLongLimitExceededCalled() const { |
+ return m_fontLoadLongLimitExceededCalled; |
+ } |
+ |
+ DEFINE_INLINE_TRACE() { |
+ visitor->trace(m_resource); |
+ FontResourceClient::trace(visitor); |
+ } |
+ |
+ String debugName() const override { return "MockFontResourceClient"; } |
+ |
+ private: |
+ void dispose(); |
+ |
+ Member<Resource> m_resource; |
+ bool m_fontLoadShortLimitExceededCalled; |
+ bool m_fontLoadLongLimitExceededCalled; |
+}; |
+ |
} // namespace blink |
#endif // MockResourceClients_h |