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

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: Replace in .mm files 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 <list> 10 #include <list>
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 // history. Expiring the favicon causes the bookmark's favicon to be updated 1583 // history. Expiring the favicon causes the bookmark's favicon to be updated
1584 // when the user next visits the bookmarked page. Expiring the bookmark's 1584 // when the user next visits the bookmarked page. Expiring the bookmark's
1585 // favicon is useful when the bookmark's favicon becomes incorrect (See 1585 // favicon is useful when the bookmark's favicon becomes incorrect (See
1586 // crbug.com/474421 for a sample bug which causes this). 1586 // crbug.com/474421 for a sample bug which causes this).
1587 TEST_F(BrowsingDataRemoverTest, ExpireBookmarkFavicons) { 1587 TEST_F(BrowsingDataRemoverTest, ExpireBookmarkFavicons) {
1588 GURL bookmarked_page("http://a"); 1588 GURL bookmarked_page("http://a");
1589 1589
1590 TestingProfile* profile = GetProfile(); 1590 TestingProfile* profile = GetProfile();
1591 profile->CreateBookmarkModel(true); 1591 profile->CreateBookmarkModel(true);
1592 bookmarks::BookmarkModel* bookmark_model = 1592 bookmarks::BookmarkModel* bookmark_model =
1593 BookmarkModelFactory::GetForProfile(profile); 1593 BookmarkModelFactory::GetForBrowserContext(profile);
1594 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model); 1594 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model);
1595 bookmark_model->AddURL(bookmark_model->bookmark_bar_node(), 0, 1595 bookmark_model->AddURL(bookmark_model->bookmark_bar_node(), 0,
1596 base::ASCIIToUTF16("a"), bookmarked_page); 1596 base::ASCIIToUTF16("a"), bookmarked_page);
1597 1597
1598 RemoveFaviconTester favicon_tester; 1598 RemoveFaviconTester favicon_tester;
1599 ASSERT_TRUE(favicon_tester.Init(GetProfile())); 1599 ASSERT_TRUE(favicon_tester.Init(GetProfile()));
1600 favicon_tester.VisitAndAddFavicon(bookmarked_page); 1600 favicon_tester.VisitAndAddFavicon(bookmarked_page);
1601 ASSERT_TRUE(favicon_tester.HasFaviconForPageURL(bookmarked_page)); 1601 ASSERT_TRUE(favicon_tester.HasFaviconForPageURL(bookmarked_page));
1602 1602
1603 BlockUntilBrowsingDataRemoved(browsing_data::ALL_TIME, 1603 BlockUntilBrowsingDataRemoved(browsing_data::ALL_TIME,
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2787 EXPECT_TRUE(remover->is_removing()); 2787 EXPECT_TRUE(remover->is_removing());
2788 2788
2789 // Add one more deletion and wait for it. 2789 // Add one more deletion and wait for it.
2790 BlockUntilBrowsingDataRemoved( 2790 BlockUntilBrowsingDataRemoved(
2791 browsing_data::ALL_TIME, 2791 browsing_data::ALL_TIME,
2792 BrowsingDataRemover::REMOVE_COOKIES, 2792 BrowsingDataRemover::REMOVE_COOKIES,
2793 BrowsingDataHelper::UNPROTECTED_WEB); 2793 BrowsingDataHelper::UNPROTECTED_WEB);
2794 2794
2795 EXPECT_FALSE(remover->is_removing()); 2795 EXPECT_FALSE(remover->is_removing());
2796 } 2796 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698