| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |