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

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

Issue 10765021: Make the id used in IconMsg_DownloadFavicon unique (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
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/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
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
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.
OLDNEW
« no previous file with comments | « chrome/browser/favicon/favicon_handler_delegate.h ('k') | chrome/browser/favicon/favicon_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698