| 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 8a3c4e52de2c3de17ab9b072f4701f4c60016986..4aa61b0378efa96190578b1f7142dad43b54d6ba 100644
|
| --- a/chrome/browser/favicon/favicon_handler_unittest.cc
|
| +++ b/chrome/browser/favicon/favicon_handler_unittest.cc
|
| @@ -42,14 +42,14 @@ void FillBitmap(int w, int h, std::vector<unsigned char>* output) {
|
| gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, false, output);
|
| }
|
|
|
| -void SetFaviconBitmapResult(
|
| +void SetFaviconRawBitmapResult(
|
| const GURL& icon_url,
|
| favicon_base::IconType icon_type,
|
| bool expired,
|
| - std::vector<favicon_base::FaviconBitmapResult>* favicon_bitmap_results) {
|
| + std::vector<favicon_base::FaviconRawBitmapResult>* favicon_bitmap_results) {
|
| scoped_refptr<base::RefCountedBytes> data(new base::RefCountedBytes());
|
| FillBitmap(gfx::kFaviconSize, gfx::kFaviconSize, &data->data());
|
| - favicon_base::FaviconBitmapResult bitmap_result;
|
| + favicon_base::FaviconRawBitmapResult bitmap_result;
|
| bitmap_result.expired = expired;
|
| bitmap_result.bitmap_data = data;
|
| // Use a pixel size other than (0,0) as (0,0) has a special meaning.
|
| @@ -60,13 +60,13 @@ void SetFaviconBitmapResult(
|
| favicon_bitmap_results->push_back(bitmap_result);
|
| }
|
|
|
| -void SetFaviconBitmapResult(
|
| +void SetFaviconRawBitmapResult(
|
| const GURL& icon_url,
|
| - std::vector<favicon_base::FaviconBitmapResult>* favicon_bitmap_results) {
|
| - SetFaviconBitmapResult(icon_url,
|
| - favicon_base::FAVICON,
|
| - false /* expired */,
|
| - favicon_bitmap_results);
|
| + std::vector<favicon_base::FaviconRawBitmapResult>* favicon_bitmap_results) {
|
| + SetFaviconRawBitmapResult(icon_url,
|
| + favicon_base::FAVICON,
|
| + false /* expired */,
|
| + favicon_bitmap_results);
|
| }
|
|
|
| // This class is used to save the download request for verifying with test case.
|
| @@ -163,7 +163,7 @@ class HistoryRequestHandler {
|
| const int icon_type_;
|
| const std::vector<unsigned char> bitmap_data_;
|
| const gfx::Size size_;
|
| - std::vector<favicon_base::FaviconBitmapResult> history_results_;
|
| + std::vector<favicon_base::FaviconRawBitmapResult> history_results_;
|
| favicon_base::FaviconResultsCallback callback_;
|
|
|
| private:
|
| @@ -493,7 +493,7 @@ TEST_F(FaviconHandlerTest, GetFaviconFromHistory) {
|
| EXPECT_EQ(GURL(), history_handler->icon_url_);
|
| EXPECT_EQ(favicon_base::FAVICON, history_handler->icon_type_);
|
|
|
| - SetFaviconBitmapResult(icon_url, &history_handler->history_results_);
|
| + SetFaviconRawBitmapResult(icon_url, &history_handler->history_results_);
|
|
|
| // Send history response.
|
| history_handler->InvokeCallback();
|
| @@ -535,10 +535,10 @@ TEST_F(FaviconHandlerTest, DownloadFavicon) {
|
| EXPECT_EQ(favicon_base::FAVICON, history_handler->icon_type_);
|
|
|
| // Set icon data expired
|
| - SetFaviconBitmapResult(icon_url,
|
| - favicon_base::FAVICON,
|
| - true /* expired */,
|
| - &history_handler->history_results_);
|
| + SetFaviconRawBitmapResult(icon_url,
|
| + favicon_base::FAVICON,
|
| + true /* expired */,
|
| + &history_handler->history_results_);
|
| // Send history response.
|
| history_handler->InvokeCallback();
|
| // Verify FaviconHandler status
|
| @@ -604,7 +604,7 @@ TEST_F(FaviconHandlerTest, UpdateAndDownloadFavicon) {
|
| EXPECT_EQ(favicon_base::FAVICON, history_handler->icon_type_);
|
|
|
| // Set valid icon data.
|
| - SetFaviconBitmapResult(icon_url, &history_handler->history_results_);
|
| + SetFaviconRawBitmapResult(icon_url, &history_handler->history_results_);
|
|
|
| // Send history response.
|
| history_handler->InvokeCallback();
|
| @@ -685,7 +685,7 @@ TEST_F(FaviconHandlerTest, FaviconInHistoryInvalid) {
|
| EXPECT_EQ(favicon_base::FAVICON, history_handler->icon_type_);
|
|
|
| // Set non empty but invalid data.
|
| - favicon_base::FaviconBitmapResult bitmap_result;
|
| + favicon_base::FaviconRawBitmapResult bitmap_result;
|
| bitmap_result.expired = false;
|
| // Empty bitmap data is invalid.
|
| bitmap_result.bitmap_data = new base::RefCountedBytes();
|
| @@ -756,7 +756,7 @@ TEST_F(FaviconHandlerTest, UpdateFavicon) {
|
| EXPECT_EQ(GURL(), history_handler->icon_url_);
|
| EXPECT_EQ(favicon_base::FAVICON, history_handler->icon_type_);
|
|
|
| - SetFaviconBitmapResult(icon_url, &history_handler->history_results_);
|
| + SetFaviconRawBitmapResult(icon_url, &history_handler->history_results_);
|
|
|
| // Send history response.
|
| history_handler->InvokeCallback();
|
| @@ -788,7 +788,7 @@ TEST_F(FaviconHandlerTest, UpdateFavicon) {
|
| EXPECT_EQ(page_url, history_handler->page_url_);
|
|
|
| // Simulate find icon.
|
| - SetFaviconBitmapResult(new_icon_url, &history_handler->history_results_);
|
| + SetFaviconRawBitmapResult(new_icon_url, &history_handler->history_results_);
|
| history_handler->InvokeCallback();
|
|
|
| // Shouldn't request download favicon
|
| @@ -891,10 +891,10 @@ TEST_F(FaviconHandlerTest, Download2ndFaviconURLCandidate) {
|
| download_handler->Reset();
|
|
|
| // Simulates getting a expired icon from history.
|
| - SetFaviconBitmapResult(new_icon_url,
|
| - favicon_base::TOUCH_ICON,
|
| - true /* expired */,
|
| - &history_handler->history_results_);
|
| + SetFaviconRawBitmapResult(new_icon_url,
|
| + favicon_base::TOUCH_ICON,
|
| + true /* expired */,
|
| + &history_handler->history_results_);
|
| history_handler->InvokeCallback();
|
|
|
| // Verify the download request.
|
| @@ -1019,10 +1019,10 @@ TEST_F(FaviconHandlerTest, UpdateDuringDownloading) {
|
| scoped_ptr<HistoryRequestHandler> handler;
|
| handler.reset(new HistoryRequestHandler(
|
| page_url, latest_icon_url, favicon_base::TOUCH_ICON, callback));
|
| - SetFaviconBitmapResult(latest_icon_url,
|
| - favicon_base::TOUCH_ICON,
|
| - false /* expired */,
|
| - &handler->history_results_);
|
| + SetFaviconRawBitmapResult(latest_icon_url,
|
| + favicon_base::TOUCH_ICON,
|
| + false /* expired */,
|
| + &handler->history_results_);
|
| handler->InvokeCallback();
|
|
|
| // No download request.
|
|
|