| 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/invalidate_type.h" | 9 #include "content/public/browser/invalidate_type.h" |
| 10 #include "content/public/browser/navigation_entry.h" | 10 #include "content/public/browser/navigation_entry.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 explicit TestFaviconHandlerDelegate(WebContents* tab_contents) | 145 explicit TestFaviconHandlerDelegate(WebContents* tab_contents) |
| 146 : tab_contents_(tab_contents) { | 146 : tab_contents_(tab_contents) { |
| 147 } | 147 } |
| 148 | 148 |
| 149 virtual NavigationEntry* GetActiveEntry() { | 149 virtual NavigationEntry* GetActiveEntry() { |
| 150 ADD_FAILURE() << "TestFaviconHandlerDelegate::GetActiveEntry() " | 150 ADD_FAILURE() << "TestFaviconHandlerDelegate::GetActiveEntry() " |
| 151 << "should never be called in tests."; | 151 << "should never be called in tests."; |
| 152 return NULL; | 152 return NULL; |
| 153 } | 153 } |
| 154 | 154 |
| 155 virtual void StartDownload(int id, const GURL& url, int image_size) { | 155 virtual int StartDownload(const GURL& url, int image_size) { |
| 156 ADD_FAILURE() << "TestFaviconHandlerDelegate::StartDownload() " | 156 ADD_FAILURE() << "TestFaviconHandlerDelegate::StartDownload() " |
| 157 << "should never be called in tests."; | 157 << "should never be called in tests."; |
| 158 return -1; |
| 158 } | 159 } |
| 159 | 160 |
| 160 virtual void NotifyFaviconUpdated() { | 161 virtual void NotifyFaviconUpdated() { |
| 161 tab_contents_->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB); | 162 tab_contents_->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB); |
| 162 } | 163 } |
| 163 | 164 |
| 164 private: | 165 private: |
| 165 WebContents* tab_contents_; // weak | 166 WebContents* tab_contents_; // weak |
| 166 }; | 167 }; |
| 167 | 168 |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 EXPECT_EQ(0U, handler.image_urls().size()); | 945 EXPECT_EQ(0U, handler.image_urls().size()); |
| 945 | 946 |
| 946 // Verify correct icon size chosen. | 947 // Verify correct icon size chosen. |
| 947 EXPECT_EQ(icon_url_preferred1, handler.GetEntry()->GetFavicon().url); | 948 EXPECT_EQ(icon_url_preferred1, handler.GetEntry()->GetFavicon().url); |
| 948 EXPECT_TRUE(handler.GetEntry()->GetFavicon().valid); | 949 EXPECT_TRUE(handler.GetEntry()->GetFavicon().valid); |
| 949 EXPECT_FALSE(handler.GetEntry()->GetFavicon().bitmap.empty()); | 950 EXPECT_FALSE(handler.GetEntry()->GetFavicon().bitmap.empty()); |
| 950 EXPECT_EQ(gfx::kFaviconSize, handler.GetEntry()->GetFavicon().bitmap.width()); | 951 EXPECT_EQ(gfx::kFaviconSize, handler.GetEntry()->GetFavicon().bitmap.width()); |
| 951 } | 952 } |
| 952 | 953 |
| 953 } // namespace. | 954 } // namespace. |
| OLD | NEW |