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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
13 #include "base/memory/ref_counted_memory.h" | 13 #include "base/memory/ref_counted_memory.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/strings/stringprintf.h" |
| 16 #include "components/history/core/browser/history_backend_client.h" |
15 #include "components/history/core/browser/thumbnail_database.h" | 17 #include "components/history/core/browser/thumbnail_database.h" |
16 #include "components/history/core/test/database_test_utils.h" | 18 #include "components/history/core/test/database_test_utils.h" |
17 #include "sql/connection.h" | 19 #include "sql/connection.h" |
18 #include "sql/recovery.h" | 20 #include "sql/recovery.h" |
19 #include "sql/test/scoped_error_expecter.h" | 21 #include "sql/test/scoped_error_expecter.h" |
20 #include "sql/test/test_helpers.h" | 22 #include "sql/test/test_helpers.h" |
| 23 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
22 #include "third_party/sqlite/sqlite3.h" | 25 #include "third_party/sqlite/sqlite3.h" |
23 #include "url/gurl.h" | 26 #include "url/gurl.h" |
24 | 27 |
| 28 using testing::StrictMock; |
| 29 using testing::Return; |
| 30 |
25 namespace history { | 31 namespace history { |
26 | 32 |
27 namespace { | 33 namespace { |
28 | 34 |
29 // Blobs for the bitmap tests. These aren't real bitmaps. Golden | 35 // Blobs for the bitmap tests. These aren't real bitmaps. Golden |
30 // database files store the same blobs (see VersionN tests). | 36 // database files store the same blobs (see VersionN tests). |
31 const unsigned char kBlob1[] = | 37 const unsigned char kBlob1[] = |
32 "12346102356120394751634516591348710478123649165419234519234512349134"; | 38 "12346102356120394751634516591348710478123649165419234519234512349134"; |
33 const unsigned char kBlob2[] = | 39 const unsigned char kBlob2[] = |
34 "goiwuegrqrcomizqyzkjalitbahxfjytrqvpqeroicxmnlkhlzunacxaneviawrtxcywhgef"; | 40 "goiwuegrqrcomizqyzkjalitbahxfjytrqvpqeroicxmnlkhlzunacxaneviawrtxcywhgef"; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 168 } |
163 | 169 |
164 bool CompareIconMappingIconUrl(const IconMapping& a, const IconMapping& b) { | 170 bool CompareIconMappingIconUrl(const IconMapping& a, const IconMapping& b) { |
165 return a.icon_url < b.icon_url; | 171 return a.icon_url < b.icon_url; |
166 } | 172 } |
167 | 173 |
168 void SortMappingsByIconUrl(std::vector<IconMapping>* mappings) { | 174 void SortMappingsByIconUrl(std::vector<IconMapping>* mappings) { |
169 std::sort(mappings->begin(), mappings->end(), &CompareIconMappingIconUrl); | 175 std::sort(mappings->begin(), mappings->end(), &CompareIconMappingIconUrl); |
170 } | 176 } |
171 | 177 |
| 178 class MockHistoryBackendClient : public HistoryBackendClient { |
| 179 public: |
| 180 // MOCK_METHOD0(~HistoryBackendClient, void()); |
| 181 MOCK_METHOD1(IsBookmarked, bool(const GURL& url)); |
| 182 MOCK_METHOD1(GetBookmarks, void(std::vector<URLAndTitle>* bookmarks)); |
| 183 MOCK_METHOD0(ShouldReportDatabaseError, bool()); |
| 184 MOCK_METHOD1(IsWebSafe, bool(const GURL& url)); |
| 185 |
| 186 #if defined(OS_ANDROID) |
| 187 MOCK_METHOD4(OnHistoryBackendInitialized, |
| 188 void(HistoryBackend* history_backend, |
| 189 HistoryDatabase* history_database, |
| 190 ThumbnailDatabase* thumbnail_database, |
| 191 const base::FilePath& history_dir)); |
| 192 MOCK_METHOD2(OnHistoryBackendDestroyed, |
| 193 void(HistoryBackend* history_backend, |
| 194 const base::FilePath& history_dir)); |
| 195 #endif // defined(OS_ANDROID) |
| 196 }; |
| 197 |
172 } // namespace | 198 } // namespace |
173 | 199 |
174 class ThumbnailDatabaseTest : public testing::Test { | 200 class ThumbnailDatabaseTest : public testing::Test { |
175 public: | 201 public: |
176 ThumbnailDatabaseTest() {} | 202 ThumbnailDatabaseTest() {} |
177 ~ThumbnailDatabaseTest() override {} | 203 ~ThumbnailDatabaseTest() override {} |
178 | 204 |
179 // Initialize a thumbnail database instance from the SQL file at | 205 // Initialize a thumbnail database instance from the SQL file at |
180 // |golden_path| in the "History/" subdirectory of test data. | 206 // |golden_path| in the "History/" subdirectory of test data. |
181 std::unique_ptr<ThumbnailDatabase> LoadFromGolden(const char* golden_path) { | 207 std::unique_ptr<ThumbnailDatabase> LoadFromGolden(const char* golden_path) { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 db.TouchOnDemandFavicon(url, end); | 386 db.TouchOnDemandFavicon(url, end); |
361 | 387 |
362 base::Time last_updated; | 388 base::Time last_updated; |
363 base::Time last_requested; | 389 base::Time last_requested; |
364 EXPECT_TRUE(db.GetFaviconBitmap(bitmap, &last_updated, &last_requested, | 390 EXPECT_TRUE(db.GetFaviconBitmap(bitmap, &last_updated, &last_requested, |
365 nullptr, nullptr)); | 391 nullptr, nullptr)); |
366 EXPECT_EQ(start, last_updated); // Does not mess with last_updated. | 392 EXPECT_EQ(start, last_updated); // Does not mess with last_updated. |
367 EXPECT_EQ(base::Time(), last_requested); // No update. | 393 EXPECT_EQ(base::Time(), last_requested); // No update. |
368 } | 394 } |
369 | 395 |
| 396 const int kOnDemandIcons = 20; |
| 397 const int kPagesPerIcon = 10; |
| 398 |
| 399 const int kRepetitions = 50; |
| 400 |
| 401 const int kOnVisitIcons = kOnDemandIcons * 10; |
| 402 |
| 403 void FillInOnDemandIcons(ThumbnailDatabase* db, |
| 404 MockHistoryBackendClient* mock_client, |
| 405 const base::Time start) { |
| 406 std::vector<unsigned char> data(kBlob1, kBlob1 + sizeof(kBlob1)); |
| 407 scoped_refptr<base::RefCountedBytes> favicon(new base::RefCountedBytes(data)); |
| 408 |
| 409 for (int x = 0; x < kOnDemandIcons; ++x) { |
| 410 // Icon: old unused case (not bookmarked). |
| 411 GURL icon_url(base::StringPrintf("http://google.com/%d/favicon.png", x)); |
| 412 favicon_base::FaviconID icon = |
| 413 db->AddFavicon(icon_url, favicon_base::FAVICON); |
| 414 ASSERT_NE(0, icon); |
| 415 FaviconBitmapID bitmap = db->AddFaviconBitmap( |
| 416 icon, favicon, FaviconBitmapType::ON_DEMAND, start, gfx::Size()); |
| 417 ASSERT_NE(0, bitmap); |
| 418 |
| 419 for (int y = 0; y < kPagesPerIcon; ++y) { |
| 420 GURL page_url(base::StringPrintf("http://google.com/%d/%d", x, y)); |
| 421 ASSERT_NE(0, db->AddIconMapping(page_url, icon)); |
| 422 EXPECT_CALL(*mock_client, IsBookmarked(page_url)).WillOnce(Return(false)); |
| 423 } |
| 424 } |
| 425 } |
| 426 |
| 427 void FillInOnVisitIcons(ThumbnailDatabase* db, |
| 428 MockHistoryBackendClient* mock_client, |
| 429 const base::Time start) { |
| 430 std::vector<unsigned char> data(kBlob1, kBlob1 + sizeof(kBlob1)); |
| 431 scoped_refptr<base::RefCountedBytes> favicon(new base::RefCountedBytes(data)); |
| 432 |
| 433 for (int x = 0; x < kOnVisitIcons; ++x) { |
| 434 // Icon: old unused case (not bookmarked). |
| 435 GURL icon_url(base::StringPrintf("http://google.com/%d/favicon.png", x)); |
| 436 favicon_base::FaviconID icon = |
| 437 db->AddFavicon(icon_url, favicon_base::FAVICON); |
| 438 ASSERT_NE(0, icon); |
| 439 FaviconBitmapID bitmap = db->AddFaviconBitmap( |
| 440 icon, favicon, FaviconBitmapType::ON_VISIT, start, gfx::Size()); |
| 441 ASSERT_NE(0, bitmap); |
| 442 |
| 443 for (int y = 0; y < kPagesPerIcon; ++y) { |
| 444 GURL page_url(base::StringPrintf("http://google.com/%d/%d", x, y)); |
| 445 ASSERT_NE(0, db->AddIconMapping(page_url, icon)); |
| 446 } |
| 447 } |
| 448 } |
| 449 |
| 450 TEST_F(ThumbnailDatabaseTest, ClearOldOnDemandFaviconsPerformanceVanilla) { |
| 451 StrictMock<MockHistoryBackendClient> mock_client; |
| 452 ThumbnailDatabase db(&mock_client); |
| 453 ASSERT_EQ(sql::INIT_OK, db.Init(file_name_)); |
| 454 db.BeginTransaction(); |
| 455 |
| 456 base::Time start; |
| 457 ASSERT_TRUE(base::Time::FromUTCExploded({2017, 5, 0, 1, 0, 0, 0, 0}, &start)); |
| 458 |
| 459 FillInOnVisitIcons(&db, &mock_client, start); |
| 460 |
| 461 base::TimeDelta time_sum; |
| 462 base::Time delete_older_than = start + base::TimeDelta::FromDays(7); |
| 463 |
| 464 for (int i = 0; i < kRepetitions; ++i) { |
| 465 FillInOnDemandIcons(&db, &mock_client, start); |
| 466 |
| 467 base::Time start_test = base::Time::Now(); |
| 468 db.ClearOldOnDemandFavicons(delete_older_than); |
| 469 time_sum += (base::Time::Now() - start_test); |
| 470 DLOG(WARNING) << "Take " << (i + 1) << ": " |
| 471 << (base::Time::Now() - start_test); |
| 472 } |
| 473 |
| 474 DLOG(WARNING) << "Average: " << (time_sum / kRepetitions); |
| 475 } |
| 476 |
| 477 TEST_F(ThumbnailDatabaseTest, ClearOldOnDemandFaviconsPerformanceOneByOne) { |
| 478 StrictMock<MockHistoryBackendClient> mock_client; |
| 479 ThumbnailDatabase db(&mock_client); |
| 480 ASSERT_EQ(sql::INIT_OK, db.Init(file_name_)); |
| 481 db.BeginTransaction(); |
| 482 |
| 483 base::Time start; |
| 484 ASSERT_TRUE(base::Time::FromUTCExploded({2017, 5, 0, 1, 0, 0, 0, 0}, &start)); |
| 485 |
| 486 FillInOnVisitIcons(&db, &mock_client, start); |
| 487 |
| 488 base::TimeDelta time_sum; |
| 489 base::Time delete_older_than = start + base::TimeDelta::FromDays(7); |
| 490 |
| 491 for (int i = 0; i < kRepetitions; ++i) { |
| 492 FillInOnDemandIcons(&db, &mock_client, start); |
| 493 |
| 494 base::Time start_test = base::Time::Now(); |
| 495 db.ClearOldOnDemandFaviconsOneByOne(delete_older_than); |
| 496 time_sum += (base::Time::Now() - start_test); |
| 497 DLOG(WARNING) << "Take " << (i + 1) << ": " |
| 498 << (base::Time::Now() - start_test); |
| 499 } |
| 500 |
| 501 DLOG(WARNING) << "Average: " << (time_sum / kRepetitions); |
| 502 } |
| 503 |
| 504 TEST_F(ThumbnailDatabaseTest, ClearOldOnDemandFaviconsPerformanceNoJoin) { |
| 505 StrictMock<MockHistoryBackendClient> mock_client; |
| 506 ThumbnailDatabase db(&mock_client); |
| 507 ASSERT_EQ(sql::INIT_OK, db.Init(file_name_)); |
| 508 db.BeginTransaction(); |
| 509 |
| 510 base::Time start; |
| 511 ASSERT_TRUE(base::Time::FromUTCExploded({2017, 5, 0, 1, 0, 0, 0, 0}, &start)); |
| 512 |
| 513 FillInOnVisitIcons(&db, &mock_client, start); |
| 514 |
| 515 base::TimeDelta time_sum; |
| 516 base::Time delete_older_than = start + base::TimeDelta::FromDays(7); |
| 517 |
| 518 for (int i = 0; i < kRepetitions; ++i) { |
| 519 FillInOnDemandIcons(&db, &mock_client, start); |
| 520 |
| 521 base::Time start_test = base::Time::Now(); |
| 522 db.ClearOldOnDemandFaviconsNoJoin(delete_older_than); |
| 523 time_sum += (base::Time::Now() - start_test); |
| 524 DLOG(WARNING) << "Take " << (i + 1) << ": " |
| 525 << (base::Time::Now() - start_test); |
| 526 } |
| 527 |
| 528 DLOG(WARNING) << "Average: " << (time_sum / kRepetitions); |
| 529 } |
| 530 |
| 531 TEST_F(ThumbnailDatabaseTest, ClearOldOnDemandFaviconsSuccess) { |
| 532 StrictMock<MockHistoryBackendClient> mock_client; |
| 533 ThumbnailDatabase db(&mock_client); |
| 534 ASSERT_EQ(sql::INIT_OK, db.Init(file_name_)); |
| 535 db.BeginTransaction(); |
| 536 |
| 537 base::Time start; |
| 538 ASSERT_TRUE(base::Time::FromUTCExploded({2017, 5, 0, 1, 0, 0, 0, 0}, &start)); |
| 539 std::vector<unsigned char> data(kBlob1, kBlob1 + sizeof(kBlob1)); |
| 540 scoped_refptr<base::RefCountedBytes> favicon(new base::RefCountedBytes(data)); |
| 541 |
| 542 // Icon: old unused case (not bookmarked). |
| 543 GURL url("http://google.com"); |
| 544 EXPECT_CALL(mock_client, IsBookmarked(url)).WillOnce(Return(false)); |
| 545 favicon_base::FaviconID icon = db.AddFavicon(url, favicon_base::FAVICON); |
| 546 ASSERT_NE(0, icon); |
| 547 FaviconBitmapID bitmap = db.AddFaviconBitmap( |
| 548 icon, favicon, FaviconBitmapType::ON_DEMAND, start, gfx::Size()); |
| 549 ASSERT_NE(0, bitmap); |
| 550 ASSERT_NE(0, db.AddIconMapping(url, icon)); |
| 551 |
| 552 base::Time delete_older_than = start + base::TimeDelta::FromDays(7); |
| 553 db.ClearOldOnDemandFavicons(delete_older_than); |
| 554 |
| 555 // The icon gets deleted. |
| 556 EXPECT_FALSE(db.GetIconMappingsForPageURL(url, nullptr)); |
| 557 EXPECT_FALSE(db.GetFaviconHeader(icon, nullptr, nullptr)); |
| 558 EXPECT_FALSE(db.GetFaviconBitmaps(icon, nullptr)); |
| 559 } |
| 560 |
| 561 TEST_F(ThumbnailDatabaseTest, ClearOldOnDemandFaviconsDoesNotDeleteFreshOne) { |
| 562 StrictMock<MockHistoryBackendClient> mock_client; |
| 563 ThumbnailDatabase db(&mock_client); |
| 564 ASSERT_EQ(sql::INIT_OK, db.Init(file_name_)); |
| 565 db.BeginTransaction(); |
| 566 |
| 567 base::Time start; |
| 568 ASSERT_TRUE(base::Time::FromUTCExploded({2017, 5, 0, 1, 0, 0, 0, 0}, &start)); |
| 569 std::vector<unsigned char> data(kBlob1, kBlob1 + sizeof(kBlob1)); |
| 570 scoped_refptr<base::RefCountedBytes> favicon(new base::RefCountedBytes(data)); |
| 571 |
| 572 // Icon: freshly used case. |
| 573 GURL url("http://google.com"); |
| 574 favicon_base::FaviconID icon = db.AddFavicon(url, favicon_base::FAVICON); |
| 575 ASSERT_NE(0, icon); |
| 576 FaviconBitmapID bitmap = db.AddFaviconBitmap( |
| 577 icon, favicon, FaviconBitmapType::ON_DEMAND, start, gfx::Size()); |
| 578 ASSERT_NE(0, bitmap); |
| 579 ASSERT_NE(0, db.AddIconMapping(url, icon)); |
| 580 |
| 581 // Touch the icon 3 weeks later. |
| 582 base::Time now = start + base::TimeDelta::FromDays(21); |
| 583 EXPECT_TRUE(db.TouchOnDemandFavicon(url, now)); |
| 584 |
| 585 base::Time delete_older_than = start + base::TimeDelta::FromDays(7); |
| 586 db.ClearOldOnDemandFavicons(delete_older_than); |
| 587 |
| 588 // Nothing gets deleted. |
| 589 EXPECT_TRUE(db.GetFaviconHeader(icon, nullptr, nullptr)); |
| 590 std::vector<FaviconBitmap> favicon_bitmaps; |
| 591 EXPECT_TRUE(db.GetFaviconBitmaps(icon, &favicon_bitmaps)); |
| 592 EXPECT_EQ(1u, favicon_bitmaps.size()); |
| 593 std::vector<IconMapping> icon_mapping; |
| 594 EXPECT_TRUE(db.GetIconMappingsForPageURL(url, &icon_mapping)); |
| 595 EXPECT_EQ(1u, icon_mapping.size()); |
| 596 EXPECT_EQ(icon, icon_mapping[0].icon_id); |
| 597 } |
| 598 |
| 599 TEST_F(ThumbnailDatabaseTest, ClearOldOnDemandFaviconsDoesNotDeleteBookmarked) { |
| 600 StrictMock<MockHistoryBackendClient> mock_client; |
| 601 ThumbnailDatabase db(&mock_client); |
| 602 ASSERT_EQ(sql::INIT_OK, db.Init(file_name_)); |
| 603 db.BeginTransaction(); |
| 604 |
| 605 base::Time start; |
| 606 ASSERT_TRUE(base::Time::FromUTCExploded({2017, 5, 0, 1, 0, 0, 0, 0}, &start)); |
| 607 std::vector<unsigned char> data(kBlob1, kBlob1 + sizeof(kBlob1)); |
| 608 scoped_refptr<base::RefCountedBytes> favicon(new base::RefCountedBytes(data)); |
| 609 |
| 610 // Icon: unused but bookmarked case. |
| 611 GURL url("http://google.com"); |
| 612 EXPECT_CALL(mock_client, IsBookmarked(url)).WillOnce(Return(true)); |
| 613 favicon_base::FaviconID icon = db.AddFavicon(url, favicon_base::FAVICON); |
| 614 ASSERT_NE(0, icon); |
| 615 FaviconBitmapID bitmap = db.AddFaviconBitmap( |
| 616 icon, favicon, FaviconBitmapType::ON_DEMAND, start, gfx::Size()); |
| 617 ASSERT_NE(0, bitmap); |
| 618 ASSERT_NE(0, db.AddIconMapping(url, icon)); |
| 619 |
| 620 base::Time delete_older_than = start + base::TimeDelta::FromDays(7); |
| 621 db.ClearOldOnDemandFavicons(delete_older_than); |
| 622 |
| 623 // Nothing gets deleted. |
| 624 EXPECT_TRUE(db.GetFaviconHeader(icon, nullptr, nullptr)); |
| 625 std::vector<FaviconBitmap> favicon_bitmaps; |
| 626 EXPECT_TRUE(db.GetFaviconBitmaps(icon, &favicon_bitmaps)); |
| 627 EXPECT_EQ(1u, favicon_bitmaps.size()); |
| 628 std::vector<IconMapping> icon_mapping; |
| 629 EXPECT_TRUE(db.GetIconMappingsForPageURL(url, &icon_mapping)); |
| 630 EXPECT_EQ(1u, icon_mapping.size()); |
| 631 EXPECT_EQ(icon, icon_mapping[0].icon_id); |
| 632 } |
| 633 |
| 634 TEST_F(ThumbnailDatabaseTest, ClearOldOnDemandFaviconsDoesNotDeleteStandard) { |
| 635 StrictMock<MockHistoryBackendClient> mock_client; |
| 636 ThumbnailDatabase db(&mock_client); |
| 637 ASSERT_EQ(sql::INIT_OK, db.Init(file_name_)); |
| 638 db.BeginTransaction(); |
| 639 |
| 640 base::Time start; |
| 641 ASSERT_TRUE(base::Time::FromUTCExploded({2017, 5, 0, 1, 0, 0, 0, 0}, &start)); |
| 642 std::vector<unsigned char> data(kBlob1, kBlob1 + sizeof(kBlob1)); |
| 643 scoped_refptr<base::RefCountedBytes> favicon(new base::RefCountedBytes(data)); |
| 644 |
| 645 // Icon: standard favicon (not on-demand). |
| 646 GURL url("http://google.com"); |
| 647 favicon_base::FaviconID icon = db.AddFavicon(url, favicon_base::FAVICON); |
| 648 ASSERT_NE(0, icon); |
| 649 FaviconBitmapID bitmap = db.AddFaviconBitmap( |
| 650 icon, favicon, FaviconBitmapType::ON_VISIT, start, gfx::Size()); |
| 651 ASSERT_NE(0, bitmap); |
| 652 ASSERT_NE(0, db.AddIconMapping(url, icon)); |
| 653 |
| 654 base::Time delete_older_than = start + base::TimeDelta::FromDays(7); |
| 655 db.ClearOldOnDemandFavicons(delete_older_than); |
| 656 |
| 657 // Nothing gets deleted. |
| 658 EXPECT_TRUE(db.GetFaviconHeader(icon, nullptr, nullptr)); |
| 659 std::vector<FaviconBitmap> favicon_bitmaps; |
| 660 EXPECT_TRUE(db.GetFaviconBitmaps(icon, &favicon_bitmaps)); |
| 661 EXPECT_EQ(1u, favicon_bitmaps.size()); |
| 662 std::vector<IconMapping> icon_mapping; |
| 663 EXPECT_TRUE(db.GetIconMappingsForPageURL(url, &icon_mapping)); |
| 664 EXPECT_EQ(1u, icon_mapping.size()); |
| 665 EXPECT_EQ(icon, icon_mapping[0].icon_id); |
| 666 } |
| 667 |
370 TEST_F(ThumbnailDatabaseTest, DeleteIconMappings) { | 668 TEST_F(ThumbnailDatabaseTest, DeleteIconMappings) { |
371 ThumbnailDatabase db(NULL); | 669 ThumbnailDatabase db(NULL); |
372 ASSERT_EQ(sql::INIT_OK, db.Init(file_name_)); | 670 ASSERT_EQ(sql::INIT_OK, db.Init(file_name_)); |
373 db.BeginTransaction(); | 671 db.BeginTransaction(); |
374 | 672 |
375 std::vector<unsigned char> data(kBlob1, kBlob1 + sizeof(kBlob1)); | 673 std::vector<unsigned char> data(kBlob1, kBlob1 + sizeof(kBlob1)); |
376 scoped_refptr<base::RefCountedBytes> favicon(new base::RefCountedBytes(data)); | 674 scoped_refptr<base::RefCountedBytes> favicon(new base::RefCountedBytes(data)); |
377 | 675 |
378 GURL url("http://google.com"); | 676 GURL url("http://google.com"); |
379 favicon_base::FaviconID id = db.AddFavicon(url, favicon_base::TOUCH_ICON); | 677 favicon_base::FaviconID id = db.AddFavicon(url, favicon_base::TOUCH_ICON); |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 ThumbnailDatabase db(NULL); | 1479 ThumbnailDatabase db(NULL); |
1182 ASSERT_EQ(sql::INIT_OK, db.Init(db_path)); | 1480 ASSERT_EQ(sql::INIT_OK, db.Init(db_path)); |
1183 | 1481 |
1184 // Verify that the resulting schema is correct, whether it | 1482 // Verify that the resulting schema is correct, whether it |
1185 // involved razing the file or fixing things in place. | 1483 // involved razing the file or fixing things in place. |
1186 VerifyTablesAndColumns(&db.db_); | 1484 VerifyTablesAndColumns(&db.db_); |
1187 } | 1485 } |
1188 } | 1486 } |
1189 | 1487 |
1190 } // namespace history | 1488 } // namespace history |
OLD | NEW |