| 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;
|
|
|