Commit ddd650f7 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Backport some tests in /components/favicon to SingleThreadTaskEnvironment

These tests were previously migrated from single-threaded MessageLoop to
a multi-threaded TaskEnvironment (then named ScopedTaskEnvironment) as
part of crbug.com/891670.

//base OWNERS decided in retrospect that it was better to keep a
single-threaded option for TaskEnvironment and introduced
SingleThreadTaskEnvironment. This CL retrofits that decision for
/components/favicon.

This CL is a no-op if it passes CQ.

This CL was uploaded by git cl split.

R=mastiz@chromium.org

Bug: 891670
Change-Id: I9a8ef1f34217a8d8110454a28138963c99b66ca4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787060
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694652}
parent ac6dc1b4
......@@ -492,7 +492,8 @@ class FaviconHandlerTest : public testing::Test {
const GURL kIconURL64x64 = GURL("http://www.google.com/favicon64x64");
FaviconHandlerTest()
: task_environment_(base::test::TaskEnvironment::MainThreadType::UI) {
: task_environment_(
base::test::SingleThreadTaskEnvironment::MainThreadType::UI) {
// Register various known icon URLs.
delegate_.fake_image_downloader().Add(kIconURL10x10, IntVector{10});
delegate_.fake_image_downloader().Add(kIconURL12x12, IntVector{12});
......@@ -546,7 +547,7 @@ class FaviconHandlerTest : public testing::Test {
candidates, manifest_url);
}
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
std::unique_ptr<ui::test::ScopedSetSupportedScaleFactors>
scoped_set_supported_scale_factors_;
testing::NiceMock<MockFaviconServiceWithFake> favicon_service_;
......
......@@ -17,7 +17,7 @@ namespace favicon {
namespace {
TEST(FaviconServiceImplTest, ShouldCacheUnableToDownloadFavicons) {
base::test::TaskEnvironment task_environment;
base::test::SingleThreadTaskEnvironment task_environment;
base::ScopedTempDir history_dir;
CHECK(history_dir.CreateUniqueTempDir());
std::unique_ptr<history::HistoryService> history_service =
......
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