| OLD | NEW |
| 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 "ui/gfx/codec/png_codec.h" | 14 #include "ui/gfx/codec/png_codec.h" |
| 14 #include "ui/gfx/favicon_size.h" | 15 #include "ui/gfx/favicon_size.h" |
| 15 #include "ui/gfx/image/image.h" | 16 #include "ui/gfx/image/image.h" |
| 16 #include "third_party/skia/include/core/SkBitmap.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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 | 961 |
| 961 // Verify correct icon size chosen. | 962 // Verify correct icon size chosen. |
| 962 EXPECT_EQ(icon_url_preferred1, handler.GetEntry()->GetFavicon().url); | 963 EXPECT_EQ(icon_url_preferred1, handler.GetEntry()->GetFavicon().url); |
| 963 EXPECT_TRUE(handler.GetEntry()->GetFavicon().valid); | 964 EXPECT_TRUE(handler.GetEntry()->GetFavicon().valid); |
| 964 EXPECT_FALSE(handler.GetEntry()->GetFavicon().image.IsEmpty()); | 965 EXPECT_FALSE(handler.GetEntry()->GetFavicon().image.IsEmpty()); |
| 965 EXPECT_EQ(gfx::kFaviconSize, | 966 EXPECT_EQ(gfx::kFaviconSize, |
| 966 handler.GetEntry()->GetFavicon().image.ToSkBitmap()->width()); | 967 handler.GetEntry()->GetFavicon().image.ToSkBitmap()->width()); |
| 967 } | 968 } |
| 968 | 969 |
| 969 } // namespace. | 970 } // namespace. |
| OLD | NEW |