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

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

Issue 11411180: move favicon download code from chrome/ into content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix order Created 8 years 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/invalidate_type.h" 10 #include "content/public/browser/invalidate_type.h"
10 #include "content/public/browser/navigation_entry.h" 11 #include "content/public/browser/navigation_entry.h"
11 #include "content/public/browser/favicon_status.h"
12 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
13 #include "third_party/skia/include/core/SkBitmap.h" 13 #include "third_party/skia/include/core/SkBitmap.h"
14 #include "ui/gfx/codec/png_codec.h" 14 #include "ui/gfx/codec/png_codec.h"
15 #include "ui/gfx/favicon_size.h" 15 #include "ui/gfx/favicon_size.h"
16 #include "ui/gfx/image/image.h" 16 #include "ui/gfx/image/image.h"
17 17
18 class TestFaviconHandler; 18 class TestFaviconHandler;
19 19
20 using content::FaviconURL;
20 using content::NavigationEntry; 21 using content::NavigationEntry;
21 using content::WebContents; 22 using content::WebContents;
22 23
23 namespace { 24 namespace {
24 25
25 // Fill the given bmp with valid png data. 26 // Fill the given bmp with valid png data.
26 void FillDataToBitmap(int w, int h, SkBitmap* bmp) { 27 void FillDataToBitmap(int w, int h, SkBitmap* bmp) {
27 bmp->setConfig(SkBitmap::kARGB_8888_Config, w, h); 28 bmp->setConfig(SkBitmap::kARGB_8888_Config, w, h);
28 bmp->allocPixels(); 29 bmp->allocPixels();
29 30
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 959
959 // Verify correct icon size chosen. 960 // Verify correct icon size chosen.
960 EXPECT_EQ(icon_url_preferred1, handler.GetEntry()->GetFavicon().url); 961 EXPECT_EQ(icon_url_preferred1, handler.GetEntry()->GetFavicon().url);
961 EXPECT_TRUE(handler.GetEntry()->GetFavicon().valid); 962 EXPECT_TRUE(handler.GetEntry()->GetFavicon().valid);
962 EXPECT_FALSE(handler.GetEntry()->GetFavicon().image.IsEmpty()); 963 EXPECT_FALSE(handler.GetEntry()->GetFavicon().image.IsEmpty());
963 EXPECT_EQ(gfx::kFaviconSize, 964 EXPECT_EQ(gfx::kFaviconSize,
964 handler.GetEntry()->GetFavicon().image.ToSkBitmap()->width()); 965 handler.GetEntry()->GetFavicon().image.ToSkBitmap()->width());
965 } 966 }
966 967
967 } // namespace. 968 } // 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