diff options
author | meelapshah@chromium.org <meelapshah@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-28 01:22:25 +0000 |
---|---|---|
committer | meelapshah@chromium.org <meelapshah@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-28 01:22:25 +0000 |
commit | daa82dc7442d26d9a50e342c0d9dcee43f287df8 (patch) | |
tree | be3c211a383852579223f57be9c1ee13b84c1f6d /chrome/browser/thumbnail_store_unittest.cc | |
parent | abaa71c990b2d9dd514e9f2eefb1d2cf7b720562 (diff) | |
download | chromium_src-daa82dc7442d26d9a50e342c0d9dcee43f287df8.zip chromium_src-daa82dc7442d26d9a50e342c0d9dcee43f287df8.tar.gz chromium_src-daa82dc7442d26d9a50e342c0d9dcee43f287df8.tar.bz2 |
Make ThumbnailStore broadcast a notification when it has finished reading thumbnails from disk.
Make DOMUIThumbnailSource wait for this notification if ThumbnailStore isn't ready yet.
Also clean up some of the code.
Review URL: http://codereview.chromium.org/155911
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21785 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/thumbnail_store_unittest.cc')
-rw-r--r-- | chrome/browser/thumbnail_store_unittest.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/browser/thumbnail_store_unittest.cc b/chrome/browser/thumbnail_store_unittest.cc index 331d5df..cd8f146 100644 --- a/chrome/browser/thumbnail_store_unittest.cc +++ b/chrome/browser/thumbnail_store_unittest.cc @@ -96,8 +96,8 @@ void ThumbnailStoreTest::SetUp() { store_->cache_.reset(new ThumbnailStore::Cache); store_->redirect_urls_.reset(new history::RedirectMap); - store_->most_visited_urls_.reset(new std::vector<GURL>); - store_->most_visited_urls_->push_back(url_); + store_->most_visited_urls_.reset(new ThumbnailStore::MostVisitedMap); + (*store_->most_visited_urls_)[url_] = GURL(); } void ThumbnailStoreTest::PrintPixelDiff(SkBitmap* image_a, SkBitmap* image_b) { @@ -183,7 +183,7 @@ TEST_F(ThumbnailStoreTest, RetrieveFromDisk) { store_->InitializeFromDB(db_name_, NULL); // Write to the DB (dirty bit sould be set) store_->CommitCacheToDB(NULL, new ThumbnailStore::Cache(*store_->cache_)); - store_->cache_->clear(); // Clear it from the cache. + store_->cache_->clear(); // Clear it from the cache. // Read from the DB. SQLITE_UNIQUE_STATEMENT(statement, *store_->statement_cache_, @@ -215,7 +215,7 @@ TEST_F(ThumbnailStoreTest, FollowRedirects) { redirects.push_back(url_); // url_ = http://www.google.com/ (*store_->redirect_urls_)[my_url] = new RefCountedVector<GURL>(redirects); - store_->most_visited_urls_->push_back(my_url); + (*store_->most_visited_urls_)[url_] = my_url; EXPECT_TRUE(store_->SetPageThumbnail(GURL("google.com"), *google_, score_, false)); |