Commit 43574cce authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

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

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

This CL was uploaded by git cl split.

R=pavely@chromium.org

Bug: 891670
Change-Id: I7bd7daa3a93a1ff5166ee56bdff138cd098ab4f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787098
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarPavel Yatsuk <pavely@chromium.org>
Commit-Queue: Pavel Yatsuk <pavely@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693846}
parent ff876669
......@@ -284,7 +284,7 @@ class FCMInvalidationListenerTest : public testing::Test {
Topics registred_topics_;
private:
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
data_decoder::TestingJsonParser::ScopedFactoryOverride factory_override_;
FCMSyncNetworkChannel* fcm_sync_network_channel_;
MockRegistrationManager* registration_manager_;
......
......@@ -280,7 +280,7 @@ class FCMNetworkHandlerTest : public testing::Test {
}
private:
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
std::unique_ptr<StrictMock<MockGCMDriver>> mock_gcm_driver_;
std::unique_ptr<StrictMock<MockInstanceIDDriver>> mock_instance_id_driver_;
std::unique_ptr<StrictMock<MockInstanceID>> mock_instance_id_;
......
......@@ -98,7 +98,7 @@ class GCMInvalidationBridgeTest : public ::testing::Test {
connection_online_ = online;
}
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
signin::IdentityTestEnvironment identity_test_env_;
std::unique_ptr<gcm::GCMDriver> gcm_driver_;
std::unique_ptr<ProfileIdentityProvider> identity_provider_;
......
......@@ -189,7 +189,7 @@ class GCMNetworkChannelTest
}
private:
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
TestGCMNetworkChannelDelegate* delegate_;
std::unique_ptr<GCMNetworkChannel> gcm_network_channel_;
int network_request_count_;
......
......@@ -75,7 +75,7 @@ class InvalidationNotifierTestDelegate {
}
private:
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
std::unique_ptr<InvalidationNotifier> invalidator_;
};
......
......@@ -87,7 +87,7 @@ class NonBlockingInvalidatorTestDelegate {
}
private:
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
base::Thread io_thread_;
std::unique_ptr<jingle_glue::NetworkServiceConfigTestUtil> net_config_helper_;
std::unique_ptr<NonBlockingInvalidator> invalidator_;
......
......@@ -182,7 +182,7 @@ class PerUserTopicRegistrationManagerTest : public testing::Test {
}
private:
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
data_decoder::TestingJsonParser::ScopedFactoryOverride factory_override_;
network::TestURLLoaderFactory url_loader_factory_;
TestingPrefServiceSimple pref_service_;
......
......@@ -74,7 +74,7 @@ class PerUserTopicRegistrationRequestTest : public testing::Test {
}
private:
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
data_decoder::TestingJsonParser::ScopedFactoryOverride factory_override_;
network::TestURLLoaderFactory url_loader_factory_;
......
......@@ -223,7 +223,7 @@ class RegistrationManagerTest : public testing::Test {
private:
// Needed by timers in RegistrationManager.
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
DISALLOW_COPY_AND_ASSIGN(RegistrationManagerTest);
};
......
......@@ -445,7 +445,7 @@ class SyncInvalidationListenerTest : public testing::Test {
ObjectIdSet registered_ids_;
private:
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
notifier::FakePushClient* const fake_push_client_;
protected:
......
......@@ -85,7 +85,7 @@ class SyncSystemResourcesTest : public testing::Test {
}
// Needed by |sync_system_resources_|.
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
MockStateWriter mock_state_writer_;
PushClientChannel push_client_channel_;
SyncSystemResources sync_system_resources_;
......
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