Commit bb9e9036 authored by Olivier Li's avatar Olivier Li Committed by Commit Bot

Prevent ScopedTempDir cleanup issues in FaviconServiceImplTest

Also switch from SingleThreadedTaskEnvironment to TaskEnvironment to
prepare for activation of HistoryServiceUsesTaskScheduler activation.

The feature will soon be flipped to ENABLED_BY_DEFAULT. This will make
HistoryServiceBackend's task runner dispatch to the ThreadPool instead
of a dedicated base::Thread. The tests need to be prepared to stay
functional when that happens.

Bug: 546640
Change-Id: I6c9c414794dc86c96721bdd23ccb31765e6a31c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1976290
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Auto-Submit: Oliver Li <olivierli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726417}
parent 4ed468c1
...@@ -17,8 +17,8 @@ namespace favicon { ...@@ -17,8 +17,8 @@ namespace favicon {
namespace { namespace {
TEST(FaviconServiceImplTest, ShouldCacheUnableToDownloadFavicons) { TEST(FaviconServiceImplTest, ShouldCacheUnableToDownloadFavicons) {
base::test::SingleThreadTaskEnvironment task_environment;
base::ScopedTempDir history_dir; base::ScopedTempDir history_dir;
base::test::TaskEnvironment task_environment;
CHECK(history_dir.CreateUniqueTempDir()); CHECK(history_dir.CreateUniqueTempDir());
std::unique_ptr<history::HistoryService> history_service = std::unique_ptr<history::HistoryService> history_service =
history::CreateHistoryService(history_dir.GetPath(), /*create_db=*/false); history::CreateHistoryService(history_dir.GetPath(), /*create_db=*/false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment