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

Side by Side Diff: chrome/browser/history/history_backend_unittest.cc

Issue 1004373002: Add last_requested field to the favicon_bitmaps table of the favicons database. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge GetFaviconBitmapLastRequestedtime into GetFaviconBitmap. Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/history/thumbnail_database_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/history/core/browser/history_backend.h" 5 #include "components/history/core/browser/history_backend.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 1811
1812 // Call SetFavicons() with bitmap data for only the large bitmap. Check that 1812 // Call SetFavicons() with bitmap data for only the large bitmap. Check that
1813 // the small bitmap is in fact deleted. 1813 // the small bitmap is in fact deleted.
1814 bitmaps.clear(); 1814 bitmaps.clear();
1815 bitmaps.push_back(CreateBitmap(SK_ColorWHITE, kLargeEdgeSize)); 1815 bitmaps.push_back(CreateBitmap(SK_ColorWHITE, kLargeEdgeSize));
1816 backend_->SetFavicons(page_url, favicon_base::FAVICON, icon_url, bitmaps); 1816 backend_->SetFavicons(page_url, favicon_base::FAVICON, icon_url, bitmaps);
1817 1817
1818 scoped_refptr<base::RefCountedMemory> bitmap_data_out; 1818 scoped_refptr<base::RefCountedMemory> bitmap_data_out;
1819 gfx::Size pixel_size_out; 1819 gfx::Size pixel_size_out;
1820 EXPECT_FALSE(backend_->thumbnail_db_->GetFaviconBitmap(small_bitmap_id, 1820 EXPECT_FALSE(backend_->thumbnail_db_->GetFaviconBitmap(small_bitmap_id,
1821 NULL, &bitmap_data_out, &pixel_size_out)); 1821 NULL, NULL, &bitmap_data_out, &pixel_size_out));
1822 EXPECT_TRUE(backend_->thumbnail_db_->GetFaviconBitmap(large_bitmap_id, 1822 EXPECT_TRUE(backend_->thumbnail_db_->GetFaviconBitmap(large_bitmap_id,
1823 NULL, &bitmap_data_out, &pixel_size_out)); 1823 NULL, NULL, &bitmap_data_out, &pixel_size_out));
1824 EXPECT_TRUE(BitmapColorEqual(SK_ColorWHITE, bitmap_data_out)); 1824 EXPECT_TRUE(BitmapColorEqual(SK_ColorWHITE, bitmap_data_out));
1825 EXPECT_EQ(kLargeSize, pixel_size_out); 1825 EXPECT_EQ(kLargeSize, pixel_size_out);
1826 1826
1827 icon_mappings.clear(); 1827 icon_mappings.clear();
1828 EXPECT_TRUE(backend_->thumbnail_db_->GetIconMappingsForPageURL(page_url, 1828 EXPECT_TRUE(backend_->thumbnail_db_->GetIconMappingsForPageURL(page_url,
1829 &icon_mappings)); 1829 &icon_mappings));
1830 EXPECT_EQ(1u, icon_mappings.size()); 1830 EXPECT_EQ(1u, icon_mappings.size());
1831 EXPECT_EQ(favicon_id, icon_mappings[0].icon_id); 1831 EXPECT_EQ(favicon_id, icon_mappings[0].icon_id);
1832 1832
1833 // Notifications should have been broadcast for each call to SetFavicons(). 1833 // Notifications should have been broadcast for each call to SetFavicons().
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
3376 // Verify that the second term is no longer returned as result, and also check 3376 // Verify that the second term is no longer returned as result, and also check
3377 // at the low level that it is gone for good. The term corresponding to the 3377 // at the low level that it is gone for good. The term corresponding to the
3378 // first URLRow should not be affected. 3378 // first URLRow should not be affected.
3379 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1)); 3379 EXPECT_EQ(1u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term1));
3380 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2)); 3380 EXPECT_EQ(0u, GetNumberOfMatchingSearchTerms(kTestKeywordId, term2));
3381 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL)); 3381 EXPECT_TRUE(mem_backend_->db()->GetKeywordSearchTermRow(row1.id(), NULL));
3382 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL)); 3382 EXPECT_FALSE(mem_backend_->db()->GetKeywordSearchTermRow(row2.id(), NULL));
3383 } 3383 }
3384 3384
3385 } // namespace history 3385 } // namespace history
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/thumbnail_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698