Chromium Code Reviews| Index: chrome/browser/history/history_backend_unittest.cc |
| diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc |
| index 27ac336987bbd45c03c7a592c9222370287c02fc..943fc1bdded5a3bf32d8574267cf256b8dbdac1b 100644 |
| --- a/chrome/browser/history/history_backend_unittest.cc |
| +++ b/chrome/browser/history/history_backend_unittest.cc |
| @@ -208,6 +208,16 @@ class HistoryBackendTest : public testing::Test { |
| return test_dir_; |
| } |
| + // Returns a gfx::Size vector with small and large sizes. |
| + const std::vector<gfx::Size>& GetSizesSmallAndLarge() { |
| + CR_DEFINE_STATIC_LOCAL(std::vector<gfx::Size>, kSizesSmallAndLarge, ()); |
|
sky
2012/09/07 18:16:47
This is a test, there's no point in forcing a stat
|
| + if (kSizesSmallAndLarge.empty()) { |
| + kSizesSmallAndLarge.push_back(kSmallSize); |
| + kSizesSmallAndLarge.push_back(kLargeSize); |
| + } |
| + return kSizesSmallAndLarge; |
| + } |
| + |
| FaviconID GetFavicon(const GURL& url, IconType icon_type) { |
| std::vector<IconMapping> icon_mappings; |
| if (backend_->thumbnail_db_->GetIconMappingsForPageURL(url, icon_type, |
| @@ -236,6 +246,7 @@ class HistoryBackendTest : public testing::Test { |
| &bookmark_model_); |
| backend_->Init(std::string(), false); |
| } |
| + |
| virtual void TearDown() { |
| if (backend_.get()) |
| backend_->Closing(); |
| @@ -249,7 +260,7 @@ class HistoryBackendTest : public testing::Test { |
| } |
| void BroadcastNotifications(int type, |
| - HistoryDetails* details) { |
| + HistoryDetails* details) { |
| // Send the notifications directly to the in-memory database. |
| content::Details<HistoryDetails> det(details); |
| mem_backend_->Observe(type, content::Source<HistoryBackendTest>(NULL), det); |
| @@ -304,9 +315,9 @@ TEST_F(HistoryBackendTest, DeleteAll) { |
| GURL favicon_url1("http://www.google.com/favicon.ico"); |
| GURL favicon_url2("http://news.google.com/favicon.ico"); |
| FaviconID favicon2 = backend_->thumbnail_db_->AddFavicon(favicon_url2, |
| - FAVICON); |
| + FAVICON, GetSizesSmallAndLarge()); |
| FaviconID favicon1 = backend_->thumbnail_db_->AddFavicon(favicon_url1, |
| - FAVICON); |
| + FAVICON, GetSizesSmallAndLarge()); |
| std::vector<unsigned char> data; |
| data.push_back('a'); |