class TestFaviconClient : public FaviconClient {
public:
- virtual ~TestFaviconClient() {};
+ ~TestFaviconClient() override{};
- virtual FaviconService* GetFaviconService() OVERRIDE {
+ FaviconService* GetFaviconService() override {
// Just give none NULL value, so overridden methods can be hit.
return (FaviconService*)(1);
}
- virtual bool IsBookmarked(const GURL& url) OVERRIDE { return false; }
+ bool IsBookmarked(const GURL& url) override { return false; }
};
class TestFaviconDriver : public FaviconDriver {
public:
- TestFaviconDriver() : favicon_validity_(false) {}
+ TestFaviconDriver()
+ : favicon_validity_(false),
+ num_active_favicon_(0),
+ num_favicon_available_(0),
+ update_active_favicon_(false) {}
virtual ~TestFaviconDriver() {
}
- virtual bool IsOffTheRecord() OVERRIDE { return false; }
+ bool IsOffTheRecord() override { return false; }
- virtual const gfx::Image GetActiveFaviconImage() OVERRIDE { return image_; }
+ const gfx::Image GetActiveFaviconImage() override { return image_; }
- virtual const GURL GetActiveFaviconURL() OVERRIDE { return favicon_url_; }
+ const GURL GetActiveFaviconURL() override { return favicon_url_; }
- virtual bool GetActiveFaviconValidity() OVERRIDE { return favicon_validity_; }
+ bool GetActiveFaviconValidity() override { return favicon_validity_; }
- virtual const GURL GetActiveURL() OVERRIDE { return url_; }
+ const GURL GetActiveURL() override { return url_; }
- virtual void SetActiveFaviconImage(gfx::Image image) OVERRIDE {
- image_ = image;
- }
+ void SetActiveFaviconImage(gfx::Image image) { image_ = image; }
- virtual void SetActiveFaviconURL(GURL favicon_url) OVERRIDE {
- favicon_url_ = favicon_url;
- }
+ void SetActiveFaviconURL(GURL favicon_url) { favicon_url_ = favicon_url; }
- virtual void SetActiveFaviconValidity(bool favicon_validity) OVERRIDE {
+ void SetActiveFaviconValidity(bool favicon_validity) {
favicon_validity_ = favicon_validity;
}
- virtual int StartDownload(const GURL& url,
- int max_bitmap_size) OVERRIDE {
+ int StartDownload(const GURL& url, int max_bitmap_size) override {
ADD_FAILURE() << "TestFaviconDriver::StartDownload() "
<< "should never be called in tests.";
return -1;
}
- virtual void NotifyFaviconUpdated(bool icon_url_changed) OVERRIDE {
- ADD_FAILURE() << "TestFaviconDriver::NotifyFaviconUpdated() "
- << "should never be called in tests.";
+ void OnFaviconAvailable(const gfx::Image& image,
+ const GURL& icon_url,
+ bool update_active_favicon) override {
+ ++num_favicon_available_;
+ available_image_ = image;
+ available_icon_url_ = icon_url;
+ update_active_favicon_ = update_active_favicon;
+ if (!update_active_favicon)
+ return;
+
+ ++num_active_favicon_;
+ SetActiveFaviconURL(icon_url);
+ SetActiveFaviconValidity(true);
+ SetActiveFaviconImage(image);
}
+ size_t num_active_favicon() const { return num_active_favicon_; }
+ size_t num_favicon_available() const { return num_favicon_available_; }
+ void ResetNumActiveFavicon() { num_active_favicon_ = 0; }
+ void ResetNumFaviconAvailable() { num_favicon_available_ = 0; }
+
void SetActiveURL(GURL url) { url_ = url; }
+ const gfx::Image available_favicon() { return available_image_; }
+
+ const GURL available_icon_url() { return available_icon_url_; }
+
+ bool update_active_favicon() { return update_active_favicon_; }
+
private:
GURL favicon_url_;
GURL url_;
gfx::Image image_;
bool favicon_validity_;
+
+ // The number of times that NotifyFaviconAvailable() has been called with
+ // |is_active_favicon| is true.
+ size_t num_active_favicon_;
+ // The number of times that NotifyFaviconAvailable() has been called.
+ size_t num_favicon_available_;
+ gfx::Image available_image_;
+ GURL available_icon_url_;
+ bool update_active_favicon_;
+
DISALLOW_COPY_AND_ASSIGN(TestFaviconDriver);
};
// internals.
class TestFaviconHandler : public FaviconHandler {
public:
+ static int GetMaximalIconSize(favicon_base::IconType icon_type) {
+ return FaviconHandler::GetMaximalIconSize(icon_type);
+ }
+
TestFaviconHandler(const GURL& page_url,
FaviconClient* client,
TestFaviconDriver* driver,
Type type,
bool download_largest_icon)
: FaviconHandler(client, driver, type, download_largest_icon),
- download_id_(0),
- num_favicon_updates_(0) {
+ download_id_(0) {
driver->SetActiveURL(page_url);
download_handler_.reset(new DownloadHandler(this));
}
- virtual ~TestFaviconHandler() {
- }
+ ~TestFaviconHandler() override {}
HistoryRequestHandler* history_handler() {
return history_handler_.get();
return download_handler_.get();
}
- size_t num_favicon_update_notifications() const {
- return num_favicon_updates_;
- }
-
- void ResetNumFaviconUpdateNotifications() {
- num_favicon_updates_ = 0;
- }
-
// Methods to access favicon internals.
const std::vector<FaviconURL>& urls() {
return image_urls_;
}
protected:
- virtual void UpdateFaviconMappingAndFetch(
+ void UpdateFaviconMappingAndFetch(
const GURL& page_url,
const GURL& icon_url,
favicon_base::IconType icon_type,
const favicon_base::FaviconResultsCallback& callback,
- base::CancelableTaskTracker* tracker) OVERRIDE {
+ base::CancelableTaskTracker* tracker) override {
history_handler_.reset(new HistoryRequestHandler(page_url, icon_url,
icon_type, callback));
}
- virtual void GetFaviconFromFaviconService(
+ void GetFaviconFromFaviconService(
const GURL& icon_url,
favicon_base::IconType icon_type,
const favicon_base::FaviconResultsCallback& callback,
- base::CancelableTaskTracker* tracker) OVERRIDE {
+ base::CancelableTaskTracker* tracker) override {
history_handler_.reset(new HistoryRequestHandler(GURL(), icon_url,
icon_type, callback));
}
- virtual void GetFaviconForURLFromFaviconService(
+ void GetFaviconForURLFromFaviconService(
const GURL& page_url,
int icon_types,
const favicon_base::FaviconResultsCallback& callback,
- base::CancelableTaskTracker* tracker) OVERRIDE {
+ base::CancelableTaskTracker* tracker) override {
history_handler_.reset(new HistoryRequestHandler(page_url, GURL(),
icon_types, callback));
}
- virtual int DownloadFavicon(const GURL& image_url,
- int max_bitmap_size) OVERRIDE {
+ int DownloadFavicon(const GURL& image_url, int max_bitmap_size) override {
download_id_++;
std::vector<int> sizes;
sizes.push_back(0);
return download_id_;
}
- virtual void SetHistoryFavicons(const GURL& page_url,
- const GURL& icon_url,
- favicon_base::IconType icon_type,
- const gfx::Image& image) OVERRIDE {
+ void SetHistoryFavicons(const GURL& page_url,
+ const GURL& icon_url,
+ favicon_base::IconType icon_type,
+ const gfx::Image& image) override {
scoped_refptr<base::RefCountedMemory> bytes = image.As1xPNGBytes();
std::vector<unsigned char> bitmap_data(bytes->front(),
bytes->front() + bytes->size());
page_url, icon_url, icon_type, bitmap_data, image.Size()));
}
- virtual bool ShouldSaveFavicon(const GURL& url) OVERRIDE {
- return true;
- }
-
- virtual void NotifyFaviconUpdated(bool icon_url_changed) OVERRIDE {
- ++num_favicon_updates_;
- }
+ bool ShouldSaveFavicon(const GURL& url) override { return true; }
GURL page_url_;
scoped_ptr<DownloadHandler> download_handler_;
scoped_ptr<HistoryRequestHandler> history_handler_;
- // The number of times that NotifyFaviconUpdated() has been called.
- size_t num_favicon_updates_;
-
DISALLOW_COPY_AND_ASSIGN(TestFaviconHandler);
};
FaviconHandlerTest() {
}
- virtual ~FaviconHandlerTest() {
- }
+ ~FaviconHandlerTest() override {}
// Simulates requesting a favicon for |page_url| given:
// - We have not previously cached anything in history for |page_url| or for
// - The favicons at |candidate_icons| have edge pixel sizes of
// |candidate_icon_sizes|.
void DownloadTillDoneIgnoringHistory(
+ TestFaviconDriver* favicon_driver,
TestFaviconHandler* favicon_handler,
const GURL& page_url,
const std::vector<FaviconURL>& candidate_icons,
const int* candidate_icon_sizes) {
- UpdateFaviconURL(favicon_handler, page_url, candidate_icons);
+ UpdateFaviconURL(
+ favicon_driver, favicon_handler, page_url, candidate_icons);
EXPECT_EQ(candidate_icons.size(), favicon_handler->image_urls().size());
DownloadHandler* download_handler = favicon_handler->download_handler();
download_handler->SetImageSizes(sizes);
download_handler->InvokeCallback();
- if (favicon_handler->num_favicon_update_notifications())
+ if (favicon_driver->num_active_favicon())
return;
}
}
- void UpdateFaviconURL(
- TestFaviconHandler* favicon_handler,
- const GURL& page_url,
- const std::vector<FaviconURL>& candidate_icons) {
- favicon_handler->ResetNumFaviconUpdateNotifications();
+ void UpdateFaviconURL(TestFaviconDriver* favicon_driver,
+ TestFaviconHandler* favicon_handler,
+ const GURL& page_url,
+ const std::vector<FaviconURL>& candidate_icons) {
+ favicon_driver->ResetNumActiveFavicon();
favicon_handler->FetchFavicon(page_url);
favicon_handler->history_handler()->InvokeCallback();
favicon_handler->OnUpdateFaviconURL(candidate_icons);
}
- virtual void SetUp() {
+ void SetUp() override {
// The score computed by SelectFaviconFrames() is dependent on the supported
// scale factors of the platform. It is used for determining the goodness of
// a downloaded bitmap in FaviconHandler::OnDidDownloadFavicon().
ChromeRenderViewHostTestHarness::SetUp();
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() override {
Profile* profile = Profile::FromBrowserContext(
web_contents()->GetBrowserContext());
FaviconServiceFactory::GetInstance()->SetTestingFactory(
const int kSizes1[] = { 16, 24, 32, 48, 256 };
std::vector<FaviconURL> urls1(kSourceIconURLs,
kSourceIconURLs + arraysize(kSizes1));
- DownloadTillDoneIgnoringHistory(&handler1, kPageURL, urls1, kSizes1);
+ DownloadTillDoneIgnoringHistory(
+ &driver1, &handler1, kPageURL, urls1, kSizes1);
EXPECT_EQ(0u, handler1.image_urls().size());
EXPECT_TRUE(driver1.GetActiveFaviconValidity());
const int kSizes2[] = { 16, 24, 48, 256 };
std::vector<FaviconURL> urls2(kSourceIconURLs,
kSourceIconURLs + arraysize(kSizes2));
- DownloadTillDoneIgnoringHistory(&handler2, kPageURL, urls2, kSizes2);
+ DownloadTillDoneIgnoringHistory(
+ &driver2, &handler2, kPageURL, urls2, kSizes2);
EXPECT_TRUE(driver2.GetActiveFaviconValidity());
expected_index = 0u;
EXPECT_EQ(16, kSizes2[expected_index]);
const int kSizes3[] = { 256, 48 };
std::vector<FaviconURL> urls3(kSourceIconURLs,
kSourceIconURLs + arraysize(kSizes3));
- DownloadTillDoneIgnoringHistory(&handler3, kPageURL, urls3, kSizes3);
+ DownloadTillDoneIgnoringHistory(
+ &driver3, &handler3, kPageURL, urls3, kSizes3);
EXPECT_TRUE(driver3.GetActiveFaviconValidity());
expected_index = 1u;
EXPECT_EQ(48, kSizes3[expected_index]);
const int kSizes4[] = { 17, 256 };
std::vector<FaviconURL> urls4(kSourceIconURLs,
kSourceIconURLs + arraysize(kSizes4));
- DownloadTillDoneIgnoringHistory(&handler4, kPageURL, urls4, kSizes4);
+ DownloadTillDoneIgnoringHistory(
+ &driver4, &handler4, kPageURL, urls4, kSizes4);
EXPECT_TRUE(driver4.GetActiveFaviconValidity());
expected_index = 0u;
EXPECT_EQ(17, kSizes4[expected_index]);
kPageURL, &client, &driver1, FaviconHandler::FAVICON, true);
std::vector<FaviconURL> urls1(kSourceIconURLs,
kSourceIconURLs + arraysize(kSourceIconURLs));
- UpdateFaviconURL(&handler1, kPageURL, urls1);
+ UpdateFaviconURL(&driver1, &handler1, kPageURL, urls1);
struct ExpectedResult {
// The favicon's index in kSourceIconURLs.
// Width of largest bitmap.
int width;
} results[] = {
- // First is icon1
+ // First is icon1, though its size larger than maximal.
+ {0, 1024},
+ // Second is icon2
// The 16x16 is largest.
{1, 16},
- // Second is iocn2 though it has same size as icon1.
+ // Third is icon3 though it has same size as icon2.
// The 16x16 is largest.
{2, 16},
// The rest of bitmaps come in order, there is no sizes attribute.
{4, -1},
};
const std::vector<FaviconURL>& icons = handler1.image_urls();
- ASSERT_EQ(4u, icons.size());
- for (size_t i = 0; i < 4; ++i) {
+ ASSERT_EQ(5u, icons.size());
+ for (size_t i = 0; i < icons.size(); ++i) {
EXPECT_EQ(kSourceIconURLs[results[i].favicon_index].icon_url,
icons[i].icon_url);
if (results[i].width != -1)
TEST_F(FaviconHandlerTest, TestDownloadLargestFavicon) {
const GURL kPageURL("http://www.google.com");
- std::vector<gfx::Size> too_large;
- too_large.push_back(gfx::Size(1024, 1024));
- too_large.push_back(gfx::Size(512, 512));
+ std::vector<gfx::Size> icon1;
+ icon1.push_back(gfx::Size(1024, 1024));
+ icon1.push_back(gfx::Size(512, 512));
- std::vector<gfx::Size> one_icon;
- one_icon.push_back(gfx::Size(15, 15));
- one_icon.push_back(gfx::Size(512, 512));
+ std::vector<gfx::Size> icon2;
+ icon2.push_back(gfx::Size(15, 15));
+ icon2.push_back(gfx::Size(14, 14));
- std::vector<gfx::Size> two_icons;
- two_icons.push_back(gfx::Size(16, 16));
- two_icons.push_back(gfx::Size(14, 14));
+ std::vector<gfx::Size> icon3;
+ icon3.push_back(gfx::Size(16, 16));
+ icon3.push_back(gfx::Size(512, 512));
const FaviconURL kSourceIconURLs[] = {
FaviconURL(
- GURL("http://www.google.com/a"), favicon_base::FAVICON, too_large),
+ GURL("http://www.google.com/a"), favicon_base::FAVICON, icon1),
FaviconURL(
- GURL("http://www.google.com/b"), favicon_base::FAVICON, one_icon),
+ GURL("http://www.google.com/b"), favicon_base::FAVICON, icon2),
FaviconURL(
- GURL("http://www.google.com/c"), favicon_base::FAVICON, two_icons),
+ GURL("http://www.google.com/c"), favicon_base::FAVICON, icon3),
FaviconURL(GURL("http://www.google.com/d"),
favicon_base::FAVICON,
std::vector<gfx::Size>()),
kPageURL, &client, &driver1, FaviconHandler::FAVICON, true);
std::vector<FaviconURL> urls1(kSourceIconURLs,
kSourceIconURLs + arraysize(kSourceIconURLs));
- UpdateFaviconURL(&handler1, kPageURL, urls1);
+ UpdateFaviconURL(&driver1, &handler1, kPageURL, urls1);
// Simulate the download failed, to check whether the icons were requested
// to download according their size.
// Width of largest bitmap.
int width;
} results[] = {
- // The 1024x1024 and 512x512 icons were dropped as it excceeds maximal size,
- // image_urls_ is 4 elements.
- // The 16x16 is largest.
- {4, 2, 16},
- // The 16x16 was dropped.
- // The 15x15 is largest.
+ {5, 0, 1024},
+ {4, 2, 512},
{3, 1, 15},
// The rest of bitmaps come in order.
{2, 3, -1},
{1, 4, -1},
};
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 5; ++i) {
ASSERT_EQ(results[i].image_urls_size, handler1.image_urls().size());
EXPECT_EQ(kSourceIconURLs[results[i].favicon_index].icon_url,
handler1.current_candidate()->icon_url);
kPageURL, &client, &driver1, FaviconHandler::FAVICON, true);
std::vector<FaviconURL> urls1(kSourceIconURLs,
kSourceIconURLs + arraysize(kSourceIconURLs));
- UpdateFaviconURL(&handler1, kPageURL, urls1);
+ UpdateFaviconURL(&driver1, &handler1, kPageURL, urls1);
ASSERT_EQ(2u, handler1.urls().size());
EXPECT_EQ(kSourceIconURLs[i].icon_url, handler1.history_handler()->icon_url_);
EXPECT_EQ(kSourceIconURLs[i].icon_sizes[b],
handler1.history_handler()->size_);
+ // Verify NotifyFaviconAvailable().
+ EXPECT_FALSE(driver1.update_active_favicon());
+ EXPECT_EQ(kSourceIconURLs[i].icon_url, driver1.available_icon_url());
+ EXPECT_EQ(kSourceIconURLs[i].icon_sizes[b],
+ driver1.available_favicon().Size());
+}
+
+TEST_F(FaviconHandlerTest, TestFaviconWasScaledAfterDownload) {
+ const GURL kPageURL("http://www.google.com");
+ const int kMaximalSize =
+ TestFaviconHandler::GetMaximalIconSize(favicon_base::FAVICON);
+
+ std::vector<gfx::Size> icon1;
+ icon1.push_back(gfx::Size(kMaximalSize + 1, kMaximalSize + 1));
+
+ std::vector<gfx::Size> icon2;
+ icon2.push_back(gfx::Size(kMaximalSize + 2, kMaximalSize + 2));
+
+ const FaviconURL kSourceIconURLs[] = {
+ FaviconURL(
+ GURL("http://www.google.com/b"), favicon_base::FAVICON, icon1),
+ FaviconURL(
+ GURL("http://www.google.com/c"), favicon_base::FAVICON, icon2)};
+
+ TestFaviconClient client;
+ TestFaviconDriver driver1;
+ TestFaviconHandler handler1(
+ kPageURL, &client, &driver1, FaviconHandler::FAVICON, true);
+ std::vector<FaviconURL> urls1(kSourceIconURLs,
+ kSourceIconURLs + arraysize(kSourceIconURLs));
+ UpdateFaviconURL(&driver1, &handler1, kPageURL, urls1);
+
+ ASSERT_EQ(2u, handler1.urls().size());
+
+ // Index of largest favicon in kSourceIconURLs.
+ size_t i = 1;
+ // The largest bitmap's index in Favicon .
+ int b = 0;
+
+ // Verify the icon_bitmaps_ was initialized correctly.
+ EXPECT_EQ(kSourceIconURLs[i].icon_url,
+ handler1.current_candidate()->icon_url);
+ EXPECT_EQ(kSourceIconURLs[i].icon_sizes[b],
+ handler1.current_candidate()->icon_sizes[0]);
+
+ // Simulate no favicon from history.
+ handler1.history_handler()->history_results_.clear();
+ handler1.history_handler()->InvokeCallback();
+
+ // Verify download request
+ ASSERT_TRUE(handler1.download_handler()->HasDownload());
+ EXPECT_EQ(kSourceIconURLs[i].icon_url,
+ handler1.download_handler()->GetImageUrl());
+
+ // Give the scaled download bitmap.
+ std::vector<int> sizes;
+ sizes.push_back(kMaximalSize);
+
+ handler1.download_handler()->SetImageSizes(sizes);
+ handler1.download_handler()->InvokeCallback();
+
+ // Verify the largest bitmap has been saved into history though it was
+ // scaled down to maximal size and smaller than icon1 now.
+ EXPECT_EQ(kSourceIconURLs[i].icon_url, handler1.history_handler()->icon_url_);
+ EXPECT_EQ(gfx::Size(kMaximalSize, kMaximalSize),
+ handler1.history_handler()->size_);
}
TEST_F(FaviconHandlerTest, TestKeepDownloadedLargestFavicon) {
kPageURL, &client, &driver1, FaviconHandler::FAVICON, true);
std::vector<FaviconURL> urls1(kSourceIconURLs,
kSourceIconURLs + arraysize(kSourceIconURLs));
- UpdateFaviconURL(&handler1, kPageURL, urls1);
+ UpdateFaviconURL(&driver1, &handler1, kPageURL, urls1);
ASSERT_EQ(3u, handler1.urls().size());
// Simulate no favicon from history.
EXPECT_FALSE(favicon_service->WasUnableToDownloadFavicon(missing_icon_url));
}
+class FaviconHandlerActiveFaviconValidityParamTest :
+ public FaviconHandlerTest,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ FaviconHandlerActiveFaviconValidityParamTest() {}
+
+ ~FaviconHandlerActiveFaviconValidityParamTest() override {}
+
+ bool GetActiveFaviconValiditySetting() {
+ return GetParam();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(FaviconHandlerActiveFaviconValidityParamTest);
+};
+
+TEST_P(FaviconHandlerActiveFaviconValidityParamTest,
+ TestDownloadLargestIconDoesNotImpactActiveFaviconValidity) {
+ const GURL page_url("http://www.google.com");
+
+ std::vector<gfx::Size> one_icon;
+ one_icon.push_back(gfx::Size(15, 15));
+
+ const GURL old_favicon_url("http://www.google.com/old");
+ const GURL new_favicon_url("http://www.google.com/b");
+ const FaviconURL source_icon_urls[] = {
+ FaviconURL(new_favicon_url, favicon_base::FAVICON, one_icon)};
+ TestFaviconClient client;
+ TestFaviconDriver driver1;
+ TestFaviconHandler handler1(
+ page_url, &client, &driver1, FaviconHandler::FAVICON, true);
+ std::vector<FaviconURL> urls1(source_icon_urls,
+ source_icon_urls + arraysize(source_icon_urls));
+ UpdateFaviconURL(&driver1, &handler1, page_url, urls1);
+
+ HistoryRequestHandler* history_handler = handler1.history_handler();
+
+ // Simulate the active favicon is updated, this shouldn't happen in real
+ // use case, but we want to verify the behavior below is not impacted by
+ // accident.
+ driver1.SetActiveFaviconValidity(GetActiveFaviconValiditySetting());
+ // Simulate the get favicon from history, but favicon URL didn't match.
+ SetFaviconRawBitmapResult(old_favicon_url,
+ &history_handler->history_results_);
+ history_handler->InvokeCallback();
+ // Since we downloaded largest icon, and don't want to set active favicon
+ // NotifyFaviconAvaliable() should be called with is_active_favicon as false.
+ EXPECT_EQ(old_favicon_url, driver1.available_icon_url());
+ EXPECT_FALSE(driver1.update_active_favicon());
+ EXPECT_EQ(1u, driver1.num_favicon_available());
+
+ // We are trying to get favicon from history again.
+ history_handler = handler1.history_handler();
+ EXPECT_EQ(new_favicon_url, history_handler->icon_url_);
+ // Simulate the get expired favicon from history.
+ history_handler->history_results_.clear();
+ SetFaviconRawBitmapResult(new_favicon_url, favicon_base::FAVICON, true,
+ &history_handler->history_results_);
+ history_handler->InvokeCallback();
+ // Since we downloaded largest icon, and don't want to set active favicon
+ // NotifyFaviconAvaliable() should be called with is_active_favicon as false.
+ EXPECT_EQ(new_favicon_url, driver1.available_icon_url());
+ EXPECT_FALSE(driver1.update_active_favicon());
+ EXPECT_EQ(2u, driver1.num_favicon_available());
+
+ // We are trying to download favicon.
+ DownloadHandler* download_handler = handler1.download_handler();
+ EXPECT_TRUE(download_handler->HasDownload());
+ EXPECT_EQ(new_favicon_url, download_handler->GetImageUrl());
+ // Simulate the download succeed.
+ download_handler->InvokeCallback();
+ // Since we downloaded largest icon, and don't want to set active favicon
+ // NotifyFaviconAvaliable() should be called with is_active_favicon as false.
+ EXPECT_EQ(new_favicon_url, driver1.available_icon_url());
+ EXPECT_FALSE(driver1.update_active_favicon());
+ EXPECT_EQ(3u, driver1.num_favicon_available());
+}
+
+INSTANTIATE_TEST_CASE_P(FaviconHandlerTestActiveFaviconValidityTrueOrFalse,
+ FaviconHandlerActiveFaviconValidityParamTest,
+ ::testing::Bool());
+
} // namespace.