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

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

Issue 11777009: Remove redundant |errored| member from IconHostMsg_DidDownloadFavicon (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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') | chrome/browser/favicon/favicon_tab_helper.h » ('j') | 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/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 8 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
9 #include "content/public/browser/favicon_status.h" 9 #include "content/public/browser/favicon_status.h"
10 #include "content/public/browser/invalidate_type.h" 10 #include "content/public/browser/invalidate_type.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 } 329 }
330 } 330 }
331 331
332 void DownloadHandler::InvokeCallback() { 332 void DownloadHandler::InvokeCallback() {
333 SkBitmap bitmap; 333 SkBitmap bitmap;
334 const int kRequestedSize = gfx::kFaviconSize; 334 const int kRequestedSize = gfx::kFaviconSize;
335 int downloaded_size = (download_->image_size > 0) ? 335 int downloaded_size = (download_->image_size > 0) ?
336 download_->image_size : gfx::kFaviconSize; 336 download_->image_size : gfx::kFaviconSize;
337 FillDataToBitmap(downloaded_size, downloaded_size, &bitmap); 337 FillDataToBitmap(downloaded_size, downloaded_size, &bitmap);
338 std::vector<SkBitmap> bitmaps; 338 std::vector<SkBitmap> bitmaps;
339 bitmaps.push_back(bitmap); 339 if (!failed_)
340 bitmaps.push_back(bitmap);
340 favicon_helper_->OnDidDownloadFavicon( 341 favicon_helper_->OnDidDownloadFavicon(
341 download_->download_id, download_->image_url, failed_, 342 download_->download_id, download_->image_url, kRequestedSize, bitmaps);
342 kRequestedSize, bitmaps);
343 } 343 }
344 344
345 class FaviconHandlerTest : public ChromeRenderViewHostTestHarness { 345 class FaviconHandlerTest : public ChromeRenderViewHostTestHarness {
346 public: 346 public:
347 FaviconHandlerTest() { 347 FaviconHandlerTest() {
348 } 348 }
349 349
350 virtual ~FaviconHandlerTest() { 350 virtual ~FaviconHandlerTest() {
351 } 351 }
352 352
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 958
959 // Verify correct icon size chosen. 959 // Verify correct icon size chosen.
960 EXPECT_EQ(icon_url_preferred1, handler.GetEntry()->GetFavicon().url); 960 EXPECT_EQ(icon_url_preferred1, handler.GetEntry()->GetFavicon().url);
961 EXPECT_TRUE(handler.GetEntry()->GetFavicon().valid); 961 EXPECT_TRUE(handler.GetEntry()->GetFavicon().valid);
962 EXPECT_FALSE(handler.GetEntry()->GetFavicon().image.IsEmpty()); 962 EXPECT_FALSE(handler.GetEntry()->GetFavicon().image.IsEmpty());
963 EXPECT_EQ(gfx::kFaviconSize, 963 EXPECT_EQ(gfx::kFaviconSize,
964 handler.GetEntry()->GetFavicon().image.ToSkBitmap()->width()); 964 handler.GetEntry()->GetFavicon().image.ToSkBitmap()->width());
965 } 965 }
966 966
967 } // namespace. 967 } // namespace.
OLDNEW
« no previous file with comments | « chrome/browser/favicon/favicon_handler.cc ('k') | chrome/browser/favicon/favicon_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698