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 "chrome/browser/browsing_data/browsing_data_remover.h" | 5 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 // history. Expiring the favicon causes the bookmark's favicon to be updated | 1581 // history. Expiring the favicon causes the bookmark's favicon to be updated |
1582 // when the user next visits the bookmarked page. Expiring the bookmark's | 1582 // when the user next visits the bookmarked page. Expiring the bookmark's |
1583 // favicon is useful when the bookmark's favicon becomes incorrect (See | 1583 // favicon is useful when the bookmark's favicon becomes incorrect (See |
1584 // crbug.com/474421 for a sample bug which causes this). | 1584 // crbug.com/474421 for a sample bug which causes this). |
1585 TEST_F(BrowsingDataRemoverTest, ExpireBookmarkFavicons) { | 1585 TEST_F(BrowsingDataRemoverTest, ExpireBookmarkFavicons) { |
1586 GURL bookmarked_page("http://a"); | 1586 GURL bookmarked_page("http://a"); |
1587 | 1587 |
1588 TestingProfile* profile = GetProfile(); | 1588 TestingProfile* profile = GetProfile(); |
1589 profile->CreateBookmarkModel(true); | 1589 profile->CreateBookmarkModel(true); |
1590 bookmarks::BookmarkModel* bookmark_model = | 1590 bookmarks::BookmarkModel* bookmark_model = |
1591 BookmarkModelFactory::GetForProfile(profile); | 1591 BookmarkModelFactory::GetForBrowserContext(profile); |
1592 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model); | 1592 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model); |
1593 bookmark_model->AddURL(bookmark_model->bookmark_bar_node(), 0, | 1593 bookmark_model->AddURL(bookmark_model->bookmark_bar_node(), 0, |
1594 base::ASCIIToUTF16("a"), bookmarked_page); | 1594 base::ASCIIToUTF16("a"), bookmarked_page); |
1595 | 1595 |
1596 RemoveFaviconTester favicon_tester; | 1596 RemoveFaviconTester favicon_tester; |
1597 ASSERT_TRUE(favicon_tester.Init(GetProfile())); | 1597 ASSERT_TRUE(favicon_tester.Init(GetProfile())); |
1598 favicon_tester.VisitAndAddFavicon(bookmarked_page); | 1598 favicon_tester.VisitAndAddFavicon(bookmarked_page); |
1599 ASSERT_TRUE(favicon_tester.HasFaviconForPageURL(bookmarked_page)); | 1599 ASSERT_TRUE(favicon_tester.HasFaviconForPageURL(bookmarked_page)); |
1600 | 1600 |
1601 BlockUntilBrowsingDataRemoved(browsing_data::ALL_TIME, | 1601 BlockUntilBrowsingDataRemoved(browsing_data::ALL_TIME, |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2587 BrowsingDataRemover::ClearSettingsForOneTypeWithPredicate( | 2587 BrowsingDataRemover::ClearSettingsForOneTypeWithPredicate( |
2588 host_content_settings_map, CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, | 2588 host_content_settings_map, CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, |
2589 base::Bind(&MatchPrimaryPattern, http_pattern)); | 2589 base::Bind(&MatchPrimaryPattern, http_pattern)); |
2590 // Verify we only have one, and it's url1. | 2590 // Verify we only have one, and it's url1. |
2591 host_content_settings_map->GetSettingsForOneType( | 2591 host_content_settings_map->GetSettingsForOneType( |
2592 CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, std::string(), &host_settings); | 2592 CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, std::string(), &host_settings); |
2593 EXPECT_EQ(1u, host_settings.size()); | 2593 EXPECT_EQ(1u, host_settings.size()); |
2594 EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(url1), | 2594 EXPECT_EQ(ContentSettingsPattern::FromURLNoWildcard(url1), |
2595 host_settings[0].primary_pattern); | 2595 host_settings[0].primary_pattern); |
2596 } | 2596 } |
OLD | NEW |