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

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

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

This CL was uploaded by git cl split.

R=vitaliii@chromium.org

Bug: 891670
Change-Id: I7d613562534207fcb526a2e8cbd1bff08ddb28e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786847
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarvitaliii <vitaliii@chromium.org>
Commit-Queue: vitaliii <vitaliii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694221}
parent 1f3bf422
...@@ -302,7 +302,7 @@ class SyncFaviconCacheTest : public testing::Test { ...@@ -302,7 +302,7 @@ class SyncFaviconCacheTest : public testing::Test {
void RunUntilIdle() { task_environment_.RunUntilIdle(); } void RunUntilIdle() { task_environment_.RunUntilIdle(); }
private: private:
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
testing::NiceMock<favicon::MockFaviconService> mock_favicon_service_; testing::NiceMock<favicon::MockFaviconService> mock_favicon_service_;
FaviconCache cache_; FaviconCache cache_;
...@@ -313,7 +313,8 @@ class SyncFaviconCacheTest : public testing::Test { ...@@ -313,7 +313,8 @@ class SyncFaviconCacheTest : public testing::Test {
}; };
SyncFaviconCacheTest::SyncFaviconCacheTest() SyncFaviconCacheTest::SyncFaviconCacheTest()
: task_environment_(base::test::TaskEnvironment::MainThreadType::UI), : task_environment_(
base::test::SingleThreadTaskEnvironment::MainThreadType::UI),
cache_(&mock_favicon_service_, nullptr, kMaxSyncFavicons), cache_(&mock_favicon_service_, nullptr, kMaxSyncFavicons),
sync_processor_(new TestChangeProcessor), sync_processor_(new TestChangeProcessor),
sync_processor_wrapper_(new syncer::SyncChangeProcessorWrapperForTest( sync_processor_wrapper_(new syncer::SyncChangeProcessorWrapperForTest(
......
...@@ -121,7 +121,7 @@ class LostNavigationsRecorderTest : public testing::Test { ...@@ -121,7 +121,7 @@ class LostNavigationsRecorderTest : public testing::Test {
} }
private: private:
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
int _id; int _id;
LostNavigationsRecorder recorder_; LostNavigationsRecorder recorder_;
syncer::TestDirectorySetterUpper dir_maker_; syncer::TestDirectorySetterUpper dir_maker_;
......
...@@ -175,7 +175,7 @@ class SessionStoreOpenTest : public ::testing::Test { ...@@ -175,7 +175,7 @@ class SessionStoreOpenTest : public ::testing::Test {
~SessionStoreOpenTest() override {} ~SessionStoreOpenTest() override {}
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
TestingPrefServiceSimple pref_service_; TestingPrefServiceSimple pref_service_;
SessionSyncPrefs session_sync_prefs_; SessionSyncPrefs session_sync_prefs_;
std::unique_ptr<MockSyncSessionsClient> mock_sync_sessions_client_; std::unique_ptr<MockSyncSessionsClient> mock_sync_sessions_client_;
......
...@@ -322,7 +322,7 @@ class SessionSyncBridgeTest : public ::testing::Test { ...@@ -322,7 +322,7 @@ class SessionSyncBridgeTest : public ::testing::Test {
syncer::ModelTypeStore* underlying_store() { return store_.get(); } syncer::ModelTypeStore* underlying_store() { return store_.get(); }
private: private:
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
const std::unique_ptr<syncer::ModelTypeStore> store_; const std::unique_ptr<syncer::ModelTypeStore> store_;
// Dependencies. // Dependencies.
......
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