Index: third_party/WebKit/Source/core/fetch/FontResource.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/FontResource.cpp b/third_party/WebKit/Source/core/fetch/FontResource.cpp |
index dee2a22b3e9d2e469c0e347fc2c872d31b25f055..13b1112e5af1790b9e241975cb59ff7e25cd29e4 100644 |
--- a/third_party/WebKit/Source/core/fetch/FontResource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/FontResource.cpp |
@@ -88,6 +88,7 @@ FontResource::FontResource(const ResourceRequest& resourceRequest, |
: Resource(resourceRequest, Font, options), |
m_loadLimitState(LoadNotStarted), |
m_corsFailed(false), |
+ m_isCallbackDisabledForTesting(false), |
m_fontLoadShortLimitTimer(this, |
&FontResource::fontLoadShortLimitCallback), |
m_fontLoadLongLimitTimer(this, &FontResource::fontLoadLongLimitCallback) { |
@@ -153,8 +154,10 @@ FontPlatformData FontResource::platformDataFromCustomData( |
} |
void FontResource::willReloadAfterDiskCacheMiss() { |
+ if (m_isCallbackDisabledForTesting) |
+ return; |
+ |
DCHECK(isLoading()); |
- DCHECK(loader()->isCacheAwareLoadingActivated()); |
if (m_loadLimitState == ShortLimitExceeded || |
m_loadLimitState == LongLimitExceeded) |
@@ -173,6 +176,9 @@ void FontResource::fontLoadShortLimitCallback(TimerBase*) { |
DCHECK_EQ(m_loadLimitState, UnderLimit); |
m_loadLimitState = ShortLimitExceeded; |
+ if (m_isCallbackDisabledForTesting) |
+ return; |
+ |
// Block client callbacks if currently loading from cache. |
if (loader()->isCacheAwareLoadingActivated()) |
return; |
@@ -184,6 +190,9 @@ void FontResource::fontLoadLongLimitCallback(TimerBase*) { |
DCHECK_EQ(m_loadLimitState, ShortLimitExceeded); |
m_loadLimitState = LongLimitExceeded; |
+ if (m_isCallbackDisabledForTesting) |
+ return; |
+ |
// Block client callbacks if currently loading from cache. |
if (loader()->isCacheAwareLoadingActivated()) |
return; |