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

Backport some tests in /components/bookmarks 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/bookmarks.

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

This CL was uploaded by git cl split.

Edit: Revert changes to BookmarkNodeDataTest and BookmarkUtilsTest
      which rely on base::ThreadPool.

R=sky@chromium.org

Bug: 891670
Change-Id: I8a37c3ecc469fcbbdc52b80724f5d8b073e30414
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786903
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694840}
parent 1e59990b
...@@ -32,7 +32,7 @@ class BookmarkExpandedStateTrackerTest : public testing::Test { ...@@ -32,7 +32,7 @@ class BookmarkExpandedStateTrackerTest : public testing::Test {
void SetUp() override; void SetUp() override;
void TearDown() override; void TearDown() override;
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
TestingPrefServiceSimple prefs_; TestingPrefServiceSimple prefs_;
std::unique_ptr<BookmarkModel> model_; std::unique_ptr<BookmarkModel> model_;
......
...@@ -72,7 +72,7 @@ class BookmarkUtilsTest : public testing::Test, ...@@ -72,7 +72,7 @@ class BookmarkUtilsTest : public testing::Test,
++grouped_changes_ended_count_; ++grouped_changes_ended_count_;
} }
// Clipboard requires a message loop. // Clipboard requires a full TaskEnvironment.
base::test::TaskEnvironment task_environment_; base::test::TaskEnvironment task_environment_;
int grouped_changes_beginning_count_; int grouped_changes_beginning_count_;
......
...@@ -165,7 +165,7 @@ class ManagedBookmarksTrackerTest : public testing::Test { ...@@ -165,7 +165,7 @@ class ManagedBookmarksTrackerTest : public testing::Test {
} }
base::ScopedTempDir scoped_temp_dir_; base::ScopedTempDir scoped_temp_dir_;
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
TestingPrefServiceSimple prefs_; TestingPrefServiceSimple prefs_;
std::unique_ptr<BookmarkModel> model_; std::unique_ptr<BookmarkModel> model_;
MockBookmarkModelObserver observer_; MockBookmarkModelObserver observer_;
......
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