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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover_unittest.cc

Issue 2216713002: Use BookmarkModelFactory::GetForBrowserContext everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Eliminate Profile::FromBrowserContext in some places Created 4 years, 4 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
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 "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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698