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/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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 | 170 |
171 class TestFaviconHandlerDelegate : public FaviconHandlerDelegate { | 171 class TestFaviconHandlerDelegate : public FaviconHandlerDelegate { |
172 public: | 172 public: |
173 TestFaviconHandlerDelegate() { | 173 TestFaviconHandlerDelegate() { |
174 } | 174 } |
175 | 175 |
176 virtual ~TestFaviconHandlerDelegate() { | 176 virtual ~TestFaviconHandlerDelegate() { |
177 } | 177 } |
178 | 178 |
| 179 virtual bool IsOffTheRecord() OVERRIDE { return false; } |
| 180 |
179 virtual NavigationEntry* GetActiveEntry() OVERRIDE { | 181 virtual NavigationEntry* GetActiveEntry() OVERRIDE { |
180 ADD_FAILURE() << "TestFaviconHandlerDelegate::GetActiveEntry() " | 182 ADD_FAILURE() << "TestFaviconHandlerDelegate::GetActiveEntry() " |
181 << "should never be called in tests."; | 183 << "should never be called in tests."; |
182 return NULL; | 184 return NULL; |
183 } | 185 } |
184 | 186 |
185 virtual int StartDownload(const GURL& url, | 187 virtual int StartDownload(const GURL& url, |
186 int max_bitmap_size) OVERRIDE { | 188 int max_bitmap_size) OVERRIDE { |
187 ADD_FAILURE() << "TestFaviconHandlerDelegate::StartDownload() " | 189 ADD_FAILURE() << "TestFaviconHandlerDelegate::StartDownload() " |
188 << "should never be called in tests."; | 190 << "should never be called in tests."; |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 download_id = favicon_tab_helper->StartDownload(missing_icon_url, 0); | 1168 download_id = favicon_tab_helper->StartDownload(missing_icon_url, 0); |
1167 EXPECT_NE(0, download_id); | 1169 EXPECT_NE(0, download_id); |
1168 // Report download success with HTTP 200 status. | 1170 // Report download success with HTTP 200 status. |
1169 favicon_tab_helper->DidDownloadFavicon(download_id, 200, missing_icon_url, | 1171 favicon_tab_helper->DidDownloadFavicon(download_id, 200, missing_icon_url, |
1170 empty_icons, empty_icon_sizes); | 1172 empty_icons, empty_icon_sizes); |
1171 // Icon is not marked as UnableToDownload as HTTP status is not 404. | 1173 // Icon is not marked as UnableToDownload as HTTP status is not 404. |
1172 EXPECT_FALSE(favicon_service->WasUnableToDownloadFavicon(missing_icon_url)); | 1174 EXPECT_FALSE(favicon_service->WasUnableToDownloadFavicon(missing_icon_url)); |
1173 } | 1175 } |
1174 | 1176 |
1175 } // namespace. | 1177 } // namespace. |
OLD | NEW |