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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/last_download_finder_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/safe_browsing/incident_reporting/last_download_finder.h " 5 #include "chrome/browser/safe_browsing/incident_reporting/last_download_finder.h "
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 if (!base::DeleteFile(history_path, false) || 65 if (!base::DeleteFile(history_path, false) ||
66 base::PathExists(history_path)) { 66 base::PathExists(history_path)) {
67 ADD_FAILURE() << "failed to delete history db file " 67 ADD_FAILURE() << "failed to delete history db file "
68 << history_path.value(); 68 << history_path.value();
69 return nullptr; 69 return nullptr;
70 } 70 }
71 71
72 std::unique_ptr<history::HistoryService> history_service( 72 std::unique_ptr<history::HistoryService> history_service(
73 new history::HistoryService( 73 new history::HistoryService(
74 base::WrapUnique(new ChromeHistoryClient( 74 base::WrapUnique(new ChromeHistoryClient(
75 BookmarkModelFactory::GetForProfile(profile))), 75 BookmarkModelFactory::GetForBrowserContext(profile))),
76 std::unique_ptr<history::VisitDelegate>())); 76 std::unique_ptr<history::VisitDelegate>()));
77 if (history_service->Init( 77 if (history_service->Init(
78 history::HistoryDatabaseParamsForPath(profile->GetPath()))) { 78 history::HistoryDatabaseParamsForPath(profile->GetPath()))) {
79 return std::move(history_service); 79 return std::move(history_service);
80 } 80 }
81 81
82 ADD_FAILURE() << "failed to initialize history service"; 82 ADD_FAILURE() << "failed to initialize history service";
83 return nullptr; 83 return nullptr;
84 } 84 }
85 85
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 base::Bind(&LastDownloadFinderTest::OnLastDownload, 463 base::Bind(&LastDownloadFinderTest::OnLastDownload,
464 base::Unretained(this), &last_binary_download, 464 base::Unretained(this), &last_binary_download,
465 &last_non_binary_download, run_loop.QuitClosure()))); 465 &last_non_binary_download, run_loop.QuitClosure())));
466 466
467 run_loop.Run(); 467 run_loop.Run();
468 468
469 ASSERT_TRUE(last_binary_download); 469 ASSERT_TRUE(last_binary_download);
470 } 470 }
471 471
472 } // namespace safe_browsing 472 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_statistics_aggregator.cc ('k') | chrome/browser/storage/durable_storage_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698