0

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

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

This CL was uploaded by git cl split.

R=hashimoto@chromium.org

Bug: 891670
Change-Id: I05ed8a9c81b692d2deda1ebb32abfce3011f15cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786754
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694664}
This commit is contained in:
Gabriel Charette
2019-09-09 07:50:49 +00:00
committed by Commit Bot
parent 975795591d
commit 1858a23ce0
6 changed files with 8 additions and 8 deletions

@ -130,7 +130,7 @@ TEST(BusTest, GetObjectProxyIgnoreUnknownService) {
}
TEST(BusTest, RemoveObjectProxy) {
base::test::TaskEnvironment task_environment;
base::test::SingleThreadTaskEnvironment task_environment;
// Start the D-Bus thread.
base::Thread::Options thread_options;
@ -318,8 +318,8 @@ TEST(BusTest, DoubleAddAndRemoveMatch) {
}
TEST(BusTest, ListenForServiceOwnerChange) {
base::test::TaskEnvironment task_environment(
base::test::TaskEnvironment::MainThreadType::IO);
base::test::SingleThreadTaskEnvironment task_environment(
base::test::SingleThreadTaskEnvironment::MainThreadType::IO);
RunLoopWithExpectedCount run_loop_state;

@ -256,7 +256,7 @@ class EndToEndAsyncTest : public testing::Test {
run_loop_->Run();
}
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
std::unique_ptr<base::RunLoop> run_loop_;
std::vector<std::string> response_strings_;
std::vector<std::string> error_names_;

@ -83,7 +83,7 @@ class MockTest : public testing::Test {
protected:
std::string response_string_;
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
std::unique_ptr<base::RunLoop> run_loop_;
scoped_refptr<MockBus> mock_bus_;
scoped_refptr<MockObjectProxy> mock_proxy_;

@ -206,7 +206,7 @@ class ObjectManagerTest
WaitForMethodCallback();
}
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
std::unique_ptr<base::RunLoop> run_loop_;
std::unique_ptr<base::Thread> dbus_thread_;
scoped_refptr<Bus> bus_;

@ -159,7 +159,7 @@ class PropertyTest : public testing::Test {
}
}
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
std::unique_ptr<base::RunLoop> run_loop_;
std::unique_ptr<base::Thread> dbus_thread_;
scoped_refptr<Bus> bus_;

@ -167,7 +167,7 @@ class SignalSenderVerificationTest : public testing::Test {
base::ThreadRestrictions::SetIOAllowed(false);
}
base::test::TaskEnvironment task_environment_;
base::test::SingleThreadTaskEnvironment task_environment_;
std::unique_ptr<base::RunLoop> run_loop_;
std::unique_ptr<base::Thread> dbus_thread_;
scoped_refptr<Bus> bus_;