summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/WebKit/Source/core/fetch/MockResourceClients.cpp')
-rw-r--r--third_party/WebKit/Source/core/fetch/MockResourceClients.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp b/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
index 1894dab..f735e58 100644
--- a/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
+++ b/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
@@ -36,6 +36,7 @@ void MockResourceClient::removeAsClient()
MockImageResourceClient::MockImageResourceClient(PassRefPtrWillBeRawPtr<ImageResource> resource)
: MockResourceClient(resource)
, m_imageChangedCount(0)
+ , m_imageNotifyFinishedCount(0)
{
toImageResource(m_resource.get())->addObserver(this);
}
@@ -57,4 +58,17 @@ void MockImageResourceClient::imageChanged(ImageResource*, const IntRect*)
m_imageChangedCount++;
}
+void MockImageResourceClient::imageNotifyFinished(ImageResource*)
+{
+ ASSERT_EQ(0, m_imageNotifyFinishedCount);
+ m_imageNotifyFinishedCount++;
+}
+
+bool MockImageResourceClient::notifyFinishedCalled() const
+{
+ EXPECT_EQ(m_notifyFinishedCalled ? 1 : 0, m_imageNotifyFinishedCount);
+
+ return m_notifyFinishedCalled;
+}
+
} // namespace blink