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

Unified Diff: content/test/test_web_contents.cc

Issue 2691933004: Avoid cyclic dependency FaviconHandler<-->FaviconDriverImpl (Closed)
Patch Set: Created 3 years, 10 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: content/test/test_web_contents.cc
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc
index 3436003093b8a7b024580f9e7d5344dd4783205b..971e259faf164391fd35b1254939cf8fdad67df6 100644
--- a/content/test/test_web_contents.cc
+++ b/content/test/test_web_contents.cc
@@ -93,7 +93,10 @@ int TestWebContents::DownloadImage(const GURL& url,
bool bypass_cache,
const ImageDownloadCallback& callback) {
static int g_next_image_download_id = 0;
- return ++g_next_image_download_id;
+ ++g_next_image_download_id;
+ pending_image_downloads_[g_next_image_download_id].first = url;
+ pending_image_downloads_[g_next_image_download_id].second = callback;
+ return g_next_image_download_id;
}
void TestWebContents::TestDidNavigate(RenderFrameHost* render_frame_host,
@@ -186,6 +189,22 @@ const std::string& TestWebContents::GetSaveFrameHeaders() {
return save_frame_headers_;
}
+bool TestWebContents::TestDidDownloadImage(
+ int id,
+ int http_status_code,
+ const std::vector<SkBitmap>& bitmaps,
+ const std::vector<gfx::Size>& original_bitmap_sizes) {
+ std::map<int, std::pair<GURL, ImageDownloadCallback>>::iterator
+ pending_download = pending_image_downloads_.find(id);
+ if (pending_download == pending_image_downloads_.end())
+ return false;
+ pending_download->second.second.Run(id, http_status_code,
+ pending_download->second.first, bitmaps,
+ original_bitmap_sizes);
+ pending_image_downloads_.erase(pending_download);
+ return true;
+}
+
bool TestWebContents::CrossProcessNavigationPending() {
if (IsBrowserSideNavigationEnabled()) {
return GetRenderManager()->speculative_render_frame_host_ != nullptr;
« components/favicon/core/favicon_handler.cc ('K') | « content/test/test_web_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698