Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Unified Diff: third_party/WebKit/Source/core/fetch/MockResourceClients.cpp

Issue 1728313003: Split ImageResourceClient into ResourceClient and ImageResourceObserver [2/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
diff --git a/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp b/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
index 1894dab1aa6f2e8d149d53199923d44486ea26e3..f735e582ac7f7226d8d7e7999c61073d8a22f4ea 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
« no previous file with comments | « third_party/WebKit/Source/core/fetch/MockResourceClients.h ('k') | third_party/WebKit/Source/core/layout/LayoutImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698