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

Side by Side Diff: chrome/browser/favicon/favicon_handler_unittest.cc

Issue 215973006: Minor cleanup of FaviconHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename in test too Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/favicon/favicon_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "chrome/browser/favicon/favicon_handler.h" 6 #include "chrome/browser/favicon/favicon_handler.h"
7 #include "chrome/browser/favicon/favicon_service_factory.h" 7 #include "chrome/browser/favicon/favicon_service_factory.h"
8 #include "chrome/browser/history/history_service_factory.h" 8 #include "chrome/browser/history/history_service_factory.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 virtual void UpdateFaviconMappingAndFetch( 256 virtual void UpdateFaviconMappingAndFetch(
257 const GURL& page_url, 257 const GURL& page_url,
258 const GURL& icon_url, 258 const GURL& icon_url,
259 chrome::IconType icon_type, 259 chrome::IconType icon_type,
260 const FaviconService::FaviconResultsCallback& callback, 260 const FaviconService::FaviconResultsCallback& callback,
261 base::CancelableTaskTracker* tracker) OVERRIDE { 261 base::CancelableTaskTracker* tracker) OVERRIDE {
262 history_handler_.reset(new HistoryRequestHandler(page_url, icon_url, 262 history_handler_.reset(new HistoryRequestHandler(page_url, icon_url,
263 icon_type, callback)); 263 icon_type, callback));
264 } 264 }
265 265
266 virtual void GetFavicon( 266 virtual void GetFaviconFromFaviconService(
267 const GURL& icon_url, 267 const GURL& icon_url,
268 chrome::IconType icon_type, 268 chrome::IconType icon_type,
269 const FaviconService::FaviconResultsCallback& callback, 269 const FaviconService::FaviconResultsCallback& callback,
270 base::CancelableTaskTracker* tracker) OVERRIDE { 270 base::CancelableTaskTracker* tracker) OVERRIDE {
271 history_handler_.reset(new HistoryRequestHandler(GURL(), icon_url, 271 history_handler_.reset(new HistoryRequestHandler(GURL(), icon_url,
272 icon_type, callback)); 272 icon_type, callback));
273 } 273 }
274 274
275 virtual void GetFaviconForURL( 275 virtual void GetFaviconForURLFromFaviconService(
276 const GURL& page_url, 276 const GURL& page_url,
277 int icon_types, 277 int icon_types,
278 const FaviconService::FaviconResultsCallback& callback, 278 const FaviconService::FaviconResultsCallback& callback,
279 base::CancelableTaskTracker* tracker) OVERRIDE { 279 base::CancelableTaskTracker* tracker) OVERRIDE {
280 history_handler_.reset(new HistoryRequestHandler(page_url, GURL(), 280 history_handler_.reset(new HistoryRequestHandler(page_url, GURL(),
281 icon_types, callback)); 281 icon_types, callback));
282 } 282 }
283 283
284 virtual int DownloadFavicon(const GURL& image_url, 284 virtual int DownloadFavicon(const GURL& image_url,
285 int max_bitmap_size) OVERRIDE { 285 int max_bitmap_size) OVERRIDE {
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 download_id = favicon_tab_helper->StartDownload(missing_icon_url, 0); 1166 download_id = favicon_tab_helper->StartDownload(missing_icon_url, 0);
1167 EXPECT_NE(0, download_id); 1167 EXPECT_NE(0, download_id);
1168 // Report download success with HTTP 200 status. 1168 // Report download success with HTTP 200 status.
1169 favicon_tab_helper->DidDownloadFavicon(download_id, 200, missing_icon_url, 1169 favicon_tab_helper->DidDownloadFavicon(download_id, 200, missing_icon_url,
1170 empty_icons, empty_icon_sizes); 1170 empty_icons, empty_icon_sizes);
1171 // Icon is not marked as UnableToDownload as HTTP status is not 404. 1171 // Icon is not marked as UnableToDownload as HTTP status is not 404.
1172 EXPECT_FALSE(favicon_service->WasUnableToDownloadFavicon(missing_icon_url)); 1172 EXPECT_FALSE(favicon_service->WasUnableToDownloadFavicon(missing_icon_url));
1173 } 1173 }
1174 1174
1175 } // namespace. 1175 } // namespace.
OLDNEW
« no previous file with comments | « chrome/browser/favicon/favicon_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698