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

Unified Diff: chrome/browser/favicon/favicon_handler_unittest.cc

Issue 255843002: Renamed FaviconHandlerDelegate to FaviconDriver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed leftovers. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/favicon_handler_unittest.cc
diff --git a/chrome/browser/favicon/favicon_handler_unittest.cc b/chrome/browser/favicon/favicon_handler_unittest.cc
index a583065757deb879cfde2b008ab7c19eb41c4328..3fadf19386f22e983ee33a5214b5263dd21c413e 100644
--- a/chrome/browser/favicon/favicon_handler_unittest.cc
+++ b/chrome/browser/favicon/favicon_handler_unittest.cc
@@ -189,36 +189,36 @@ class TestFaviconClient : public FaviconClient {
virtual bool IsBookmarked(const GURL& url) OVERRIDE { return false; }
};
-class TestFaviconHandlerDelegate : public FaviconHandlerDelegate {
+class TestFaviconDriver : public FaviconDriver {
public:
- TestFaviconHandlerDelegate() {
+ TestFaviconDriver() {
}
- virtual ~TestFaviconHandlerDelegate() {
+ virtual ~TestFaviconDriver() {
}
virtual bool IsOffTheRecord() OVERRIDE { return false; }
virtual NavigationEntry* GetActiveEntry() OVERRIDE {
- ADD_FAILURE() << "TestFaviconHandlerDelegate::GetActiveEntry() "
+ ADD_FAILURE() << "TestFaviconDriver::GetActiveEntry() "
<< "should never be called in tests.";
return NULL;
}
virtual int StartDownload(const GURL& url,
int max_bitmap_size) OVERRIDE {
- ADD_FAILURE() << "TestFaviconHandlerDelegate::StartDownload() "
+ ADD_FAILURE() << "TestFaviconDriver::StartDownload() "
<< "should never be called in tests.";
return -1;
}
virtual void NotifyFaviconUpdated(bool icon_url_changed) OVERRIDE {
- ADD_FAILURE() << "TestFaviconHandlerDelegate::NotifyFaviconUpdated() "
+ ADD_FAILURE() << "TestFaviconDriver::NotifyFaviconUpdated() "
<< "should never be called in tests.";
}
private:
- DISALLOW_COPY_AND_ASSIGN(TestFaviconHandlerDelegate);
+ DISALLOW_COPY_AND_ASSIGN(TestFaviconDriver);
};
// This class is used to catch the FaviconHandler's download and history
@@ -228,10 +228,10 @@ class TestFaviconHandler : public FaviconHandler {
public:
TestFaviconHandler(const GURL& page_url,
FaviconClient* client,
- FaviconHandlerDelegate* delegate,
+ FaviconDriver* driver,
Type type,
bool download_largest_icon)
- : FaviconHandler(client, delegate, type,
+ : FaviconHandler(client, driver, type,
download_largest_icon),
entry_(NavigationEntry::Create()),
download_id_(0),
@@ -473,10 +473,10 @@ TEST_F(FaviconHandlerTest, GetFaviconFromHistory) {
const GURL page_url("http://www.google.com");
const GURL icon_url("http://www.google.com/favicon");
- TestFaviconHandlerDelegate delegate;
+ TestFaviconDriver driver;
TestFaviconClient client;
TestFaviconHandler helper(
- page_url, &client, &delegate, FaviconHandler::FAVICON, false);
+ page_url, &client, &driver, FaviconHandler::FAVICON, false);
helper.FetchFavicon(page_url);
HistoryRequestHandler* history_handler = helper.history_handler();
@@ -514,10 +514,10 @@ TEST_F(FaviconHandlerTest, DownloadFavicon) {
const GURL page_url("http://www.google.com");
const GURL icon_url("http://www.google.com/favicon");
- TestFaviconHandlerDelegate delegate;
+ TestFaviconDriver driver;
TestFaviconClient client;
TestFaviconHandler helper(
- page_url, &client, &delegate, FaviconHandler::FAVICON, false);
+ page_url, &client, &driver, FaviconHandler::FAVICON, false);
helper.FetchFavicon(page_url);
HistoryRequestHandler* history_handler = helper.history_handler();
@@ -584,10 +584,10 @@ TEST_F(FaviconHandlerTest, UpdateAndDownloadFavicon) {
const GURL icon_url("http://www.google.com/favicon");
const GURL new_icon_url("http://www.google.com/new_favicon");
- TestFaviconHandlerDelegate delegate;
+ TestFaviconDriver driver;
TestFaviconClient client;
TestFaviconHandler helper(
- page_url, &client, &delegate, FaviconHandler::FAVICON, false);
+ page_url, &client, &driver, FaviconHandler::FAVICON, false);
helper.FetchFavicon(page_url);
HistoryRequestHandler* history_handler = helper.history_handler();
@@ -666,10 +666,10 @@ TEST_F(FaviconHandlerTest, FaviconInHistoryInvalid) {
const GURL page_url("http://www.google.com");
const GURL icon_url("http://www.google.com/favicon");
- TestFaviconHandlerDelegate delegate;
+ TestFaviconDriver driver;
TestFaviconClient client;
TestFaviconHandler helper(
- page_url, &client, &delegate, FaviconHandler::FAVICON, false);
+ page_url, &client, &driver, FaviconHandler::FAVICON, false);
helper.FetchFavicon(page_url);
HistoryRequestHandler* history_handler = helper.history_handler();
@@ -739,10 +739,10 @@ TEST_F(FaviconHandlerTest, UpdateFavicon) {
const GURL icon_url("http://www.google.com/favicon");
const GURL new_icon_url("http://www.google.com/new_favicon");
- TestFaviconHandlerDelegate delegate;
+ TestFaviconDriver driver;
TestFaviconClient client;
TestFaviconHandler helper(
- page_url, &client, &delegate, FaviconHandler::FAVICON, false);
+ page_url, &client, &driver, FaviconHandler::FAVICON, false);
helper.FetchFavicon(page_url);
HistoryRequestHandler* history_handler = helper.history_handler();
@@ -801,10 +801,10 @@ TEST_F(FaviconHandlerTest, Download2ndFaviconURLCandidate) {
const GURL icon_url("http://www.google.com/favicon");
const GURL new_icon_url("http://www.google.com/new_favicon");
- TestFaviconHandlerDelegate delegate;
+ TestFaviconDriver driver;
TestFaviconClient client;
TestFaviconHandler helper(
- page_url, &client, &delegate, FaviconHandler::TOUCH, false);
+ page_url, &client, &driver, FaviconHandler::TOUCH, false);
helper.FetchFavicon(page_url);
HistoryRequestHandler* history_handler = helper.history_handler();
@@ -915,10 +915,10 @@ TEST_F(FaviconHandlerTest, UpdateDuringDownloading) {
const GURL icon_url("http://www.google.com/favicon");
const GURL new_icon_url("http://www.google.com/new_favicon");
- TestFaviconHandlerDelegate delegate;
+ TestFaviconDriver driver;
TestFaviconClient client;
TestFaviconHandler helper(
- page_url, &client, &delegate, FaviconHandler::TOUCH, false);
+ page_url, &client, &driver, FaviconHandler::TOUCH, false);
helper.FetchFavicon(page_url);
HistoryRequestHandler* history_handler = helper.history_handler();
@@ -1057,10 +1057,10 @@ TEST_F(FaviconHandlerTest, MultipleFavicons) {
// 1) Test that if there are several single resolution favicons to choose from
// that the largest exact match is chosen.
- TestFaviconHandlerDelegate delegate1;
+ TestFaviconDriver driver1;
TestFaviconClient client;
TestFaviconHandler handler1(
- kPageURL, &client, &delegate1, FaviconHandler::FAVICON, false);
+ kPageURL, &client, &driver1, FaviconHandler::FAVICON, false);
const int kSizes1[] = { 16, 24, 32, 48, 256 };
std::vector<FaviconURL> urls1(kSourceIconURLs,
@@ -1080,9 +1080,9 @@ TEST_F(FaviconHandlerTest, MultipleFavicons) {
// 2) Test that if there are several single resolution favicons to choose
// from, the exact match is preferred even if it results in upsampling.
- TestFaviconHandlerDelegate delegate2;
+ TestFaviconDriver driver2;
TestFaviconHandler handler2(
- kPageURL, &client, &delegate2, FaviconHandler::FAVICON, false);
+ kPageURL, &client, &driver2, FaviconHandler::FAVICON, false);
const int kSizes2[] = { 16, 24, 48, 256 };
std::vector<FaviconURL> urls2(kSourceIconURLs,
@@ -1096,9 +1096,9 @@ TEST_F(FaviconHandlerTest, MultipleFavicons) {
// 3) Test that favicons which need to be upsampled a little or downsampled
// a little are preferred over huge favicons.
- TestFaviconHandlerDelegate delegate3;
+ TestFaviconDriver driver3;
TestFaviconHandler handler3(
- kPageURL, &client, &delegate3, FaviconHandler::FAVICON, false);
+ kPageURL, &client, &driver3, FaviconHandler::FAVICON, false);
const int kSizes3[] = { 256, 48 };
std::vector<FaviconURL> urls3(kSourceIconURLs,
@@ -1110,9 +1110,9 @@ TEST_F(FaviconHandlerTest, MultipleFavicons) {
EXPECT_EQ(kSourceIconURLs[expected_index].icon_url,
handler3.GetEntry()->GetFavicon().url);
- TestFaviconHandlerDelegate delegate4;
+ TestFaviconDriver driver4;
TestFaviconHandler handler4(
- kPageURL, &client, &delegate4, FaviconHandler::FAVICON, false);
+ kPageURL, &client, &driver4, FaviconHandler::FAVICON, false);
const int kSizes4[] = { 17, 256 };
std::vector<FaviconURL> urls4(kSourceIconURLs,
@@ -1159,9 +1159,9 @@ TEST_F(FaviconHandlerTest, TestSortFavicon) {
std::vector<gfx::Size>())};
TestFaviconClient client;
- TestFaviconHandlerDelegate delegate1;
+ TestFaviconDriver driver1;
TestFaviconHandler handler1(
- kPageURL, &client, &delegate1, FaviconHandler::FAVICON, true);
+ kPageURL, &client, &driver1, FaviconHandler::FAVICON, true);
std::vector<FaviconURL> urls1(kSourceIconURLs,
kSourceIconURLs + arraysize(kSourceIconURLs));
UpdateFaviconURL(&handler1, kPageURL, urls1);
@@ -1224,9 +1224,9 @@ TEST_F(FaviconHandlerTest, TestDownloadLargestFavicon) {
std::vector<gfx::Size>())};
TestFaviconClient client;
- TestFaviconHandlerDelegate delegate1;
+ TestFaviconDriver driver1;
TestFaviconHandler handler1(
- kPageURL, &client, &delegate1, FaviconHandler::FAVICON, true);
+ kPageURL, &client, &driver1, FaviconHandler::FAVICON, true);
std::vector<FaviconURL> urls1(kSourceIconURLs,
kSourceIconURLs + arraysize(kSourceIconURLs));
UpdateFaviconURL(&handler1, kPageURL, urls1);
@@ -1296,9 +1296,9 @@ TEST_F(FaviconHandlerTest, TestSelectLargestFavicon) {
two_icons)};
TestFaviconClient client;
- TestFaviconHandlerDelegate delegate1;
+ TestFaviconDriver driver1;
TestFaviconHandler handler1(
- kPageURL, &client, &delegate1, FaviconHandler::FAVICON, true);
+ kPageURL, &client, &driver1, FaviconHandler::FAVICON, true);
std::vector<FaviconURL> urls1(kSourceIconURLs,
kSourceIconURLs + arraysize(kSourceIconURLs));
UpdateFaviconURL(&handler1, kPageURL, urls1);
@@ -1364,9 +1364,9 @@ TEST_F(FaviconHandlerTest, TestKeepDownloadedLargestFavicon) {
std::vector<gfx::Size>())};
TestFaviconClient client;
- TestFaviconHandlerDelegate delegate1;
+ TestFaviconDriver driver1;
TestFaviconHandler handler1(
- kPageURL, &client, &delegate1, FaviconHandler::FAVICON, true);
+ kPageURL, &client, &driver1, FaviconHandler::FAVICON, true);
std::vector<FaviconURL> urls1(kSourceIconURLs,
kSourceIconURLs + arraysize(kSourceIconURLs));
UpdateFaviconURL(&handler1, kPageURL, urls1);
« 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