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

Unified Diff: chrome/browser/history/history_unittest.cc

Issue 6283001: Remove TopSites::IsEnabled() as well as related dead code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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
Index: chrome/browser/history/history_unittest.cc
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc
index a4fcb4f8cf7f264257cbb4f55304660d6edd9339..68fc670787fc5b5c7dd9c994ff102198bcf7847a 100644
--- a/chrome/browser/history/history_unittest.cc
+++ b/chrome/browser/history/history_unittest.cc
@@ -682,73 +682,6 @@ TEST_F(HistoryTest, Segments) {
EXPECT_GT(page_usage_data_[0]->GetScore(), 5.0);
}
-// This just tests history system -> thumbnail database integration, the actual
-// thumbnail tests are in its own file.
-TEST_F(HistoryTest, Thumbnails) {
- if (history::TopSites::IsEnabled())
- return; // TopSitesTest replaces this.
-
- scoped_refptr<HistoryService> history(new HistoryService);
- history_service_ = history;
- ASSERT_TRUE(history->Init(history_dir_, NULL));
-
- scoped_ptr<SkBitmap> thumbnail(
- gfx::JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail)));
- static const double boringness = 0.25;
-
- const GURL url("http://www.google.com/thumbnail_test/");
- // Must be visited before adding a thumbnail.
- history->AddPage(url, history::SOURCE_BROWSED);
- history->SetPageThumbnail(url, *thumbnail,
- ThumbnailScore(boringness, true, true));
-
- // Make sure we get the correct thumbnail data.
- EXPECT_TRUE(history->GetPageThumbnail(url, &consumer_,
- NewCallback(static_cast<HistoryTest*>(this),
- &HistoryTest::OnThumbnailDataAvailable)));
- thumbnail_data_.clear();
- MessageLoop::current()->Run();
- // Make sure we got a valid JPEG back. This isn't equivalent to
- // being correct, but when we're roundtripping through JPEG
- // compression and we don't have a similarity measure.
- EXPECT_TRUE(thumbnail_data_.size());
- scoped_ptr<SkBitmap> decoded_thumbnail(
- gfx::JPEGCodec::Decode(&thumbnail_data_[0], thumbnail_data_.size()));
- EXPECT_TRUE(decoded_thumbnail.get());
-
- // Request a nonexistent thumbnail and make sure we get
- // a callback and no data.
- EXPECT_TRUE(history->GetPageThumbnail(GURL("http://asdfasdf.com/"),
- &consumer_,
- NewCallback(static_cast<HistoryTest*>(this),
- &HistoryTest::OnThumbnailDataAvailable)));
- thumbnail_data_.clear();
- MessageLoop::current()->Run();
- EXPECT_EQ(0U, thumbnail_data_.size());
-
- // Request the thumbnail and cancel the request..
- got_thumbnail_callback_ = false;
- thumbnail_data_.clear();
- HistoryService::Handle handle = history->GetPageThumbnail(url, &consumer_,
- NewCallback(static_cast<HistoryTest*>(this),
- &HistoryTest::OnThumbnailDataAvailable));
- EXPECT_TRUE(handle);
-
- history->CancelRequest(handle);
-
- // We create a task with a timeout so we can make sure we don't get and
- // data in that time.
- class QuitMessageLoop : public Task {
- public:
- virtual void Run() {
- MessageLoop::current()->Quit();
- }
- };
- MessageLoop::current()->PostDelayedTask(FROM_HERE, new QuitMessageLoop, 2000);
- MessageLoop::current()->Run();
- EXPECT_FALSE(got_thumbnail_callback_);
-}
-
TEST_F(HistoryTest, MostVisitedURLs) {
scoped_refptr<HistoryService> history(new HistoryService);
history_service_ = history;

Powered by Google App Engine
This is Rietveld 408576698