Chromium Code Reviews| Index: third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h |
| diff --git a/third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h b/third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c35ed00b2f4c205d9fc1727ca6c31a12067a774c |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h |
| @@ -0,0 +1,51 @@ |
| +// 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 MockFontResourceClient_h |
| +#define MockFontResourceClient_h |
| + |
| +#include "core/fetch/FontResource.h" |
|
yhirano
2016/11/17 07:30:48
#include "core/fetch/Resource.h"
Takashi Toyoshima
2016/11/17 10:18:09
Done.
|
| +#include "platform/heap/Handle.h" |
|
yhirano
2016/11/17 07:30:47
#include "wtf/text/WTFString.h"
Takashi Toyoshima
2016/11/17 10:18:09
Done.
|
| + |
| +namespace blink { |
| + |
| +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 // MockFontResourceClient_h |