Commit 497abfcc authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Remove references of MessageLoopForIO in /fuchsia

MessageLoopForIO will go away soon use ScopedTaskEnvironment instead.

ScopedTaskEnvironment will per default start a ThreadPool, which should
be fine in most of the cases. If you believe your test needs to make sure
that no ThreadPool runs let me know and I will update the patch.

BUG=891670
This CL was uploaded by git cl split.

R=scottmg@chromium.org

Change-Id: I6aaf63a8b1094b302aad010f3e48e009fe8a04fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733549
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Auto-Submit: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#684010}
parent 9c0fd5e4
...@@ -90,6 +90,7 @@ test("cr_fuchsia_base_unittests") { ...@@ -90,6 +90,7 @@ test("cr_fuchsia_base_unittests") {
"//base", "//base",
"//base:testfidl", "//base:testfidl",
"//base/test:run_all_unittests", "//base/test:run_all_unittests",
"//base/test:test_support",
"//testing/gtest", "//testing/gtest",
] ]
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "base/fuchsia/service_directory_client.h" #include "base/fuchsia/service_directory_client.h"
#include "base/fuchsia/testfidl/cpp/fidl.h" #include "base/fuchsia/testfidl/cpp/fidl.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/message_loop/message_loop.h" #include "base/test/scoped_task_environment.h"
#include "fuchsia/base/fit_adapter.h" #include "fuchsia/base/fit_adapter.h"
#include "fuchsia/base/result_receiver.h" #include "fuchsia/base/result_receiver.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -100,7 +100,9 @@ class AgentImplTest : public ::testing::Test { ...@@ -100,7 +100,9 @@ class AgentImplTest : public ::testing::Test {
return nullptr; return nullptr;
} }
base::MessageLoopForIO message_loop_; base::test::ScopedTaskEnvironment scoped_task_environment_{
base::test::ScopedTaskEnvironment::ThreadingMode::MAIN_THREAD_ONLY,
base::test::ScopedTaskEnvironment::MainThreadType::IO};
std::unique_ptr<base::fuchsia::ServiceDirectory> services_; std::unique_ptr<base::fuchsia::ServiceDirectory> services_;
std::unique_ptr<base::fuchsia::ServiceDirectoryClient> services_client_; std::unique_ptr<base::fuchsia::ServiceDirectoryClient> services_client_;
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
#include "base/fuchsia/file_utils.h" #include "base/fuchsia/file_utils.h"
#include "base/fuchsia/fuchsia_logging.h" #include "base/fuchsia/fuchsia_logging.h"
#include "base/fuchsia/service_directory.h" #include "base/fuchsia/service_directory.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/test/multiprocess_test.h" #include "base/test/multiprocess_test.h"
#include "base/test/scoped_task_environment.h"
#include "base/test/test_timeouts.h" #include "base/test/test_timeouts.h"
#include "fuchsia/engine/common.h" #include "fuchsia/engine/common.h"
#include "fuchsia/engine/fake_context.h" #include "fuchsia/engine/fake_context.h"
...@@ -46,7 +46,9 @@ constexpr char kUrl[] = "chrome://:emorhc"; ...@@ -46,7 +46,9 @@ constexpr char kUrl[] = "chrome://:emorhc";
constexpr char kTitle[] = "Palindrome"; constexpr char kTitle[] = "Palindrome";
MULTIPROCESS_TEST_MAIN(SpawnContextServer) { MULTIPROCESS_TEST_MAIN(SpawnContextServer) {
base::MessageLoopForIO message_loop; base::test::ScopedTaskEnvironment scoped_task_environment(
base::test::ScopedTaskEnvironment::ThreadingMode::MAIN_THREAD_ONLY,
base::test::ScopedTaskEnvironment::MainThreadType::IO);
base::FilePath data_dir; base::FilePath data_dir;
CHECK(base::PathService::Get(base::DIR_APP_DATA, &data_dir)); CHECK(base::PathService::Get(base::DIR_APP_DATA, &data_dir));
...@@ -177,7 +179,9 @@ class ContextProviderImplTest : public base::MultiProcessTest { ...@@ -177,7 +179,9 @@ class ContextProviderImplTest : public base::MultiProcessTest {
} }
protected: protected:
base::MessageLoopForIO message_loop_; base::test::ScopedTaskEnvironment scoped_task_environment_{
base::test::ScopedTaskEnvironment::ThreadingMode::MAIN_THREAD_ONLY,
base::test::ScopedTaskEnvironment::MainThreadType::IO};
std::unique_ptr<ContextProviderImpl> provider_; std::unique_ptr<ContextProviderImpl> provider_;
fuchsia::web::ContextProviderPtr provider_ptr_; fuchsia::web::ContextProviderPtr provider_ptr_;
fidl::BindingSet<fuchsia::web::ContextProvider> bindings_; fidl::BindingSet<fuchsia::web::ContextProvider> bindings_;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/fuchsia/file_utils.h" #include "base/fuchsia/file_utils.h"
#include "base/fuchsia/service_directory_client.h" #include "base/fuchsia/service_directory_client.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/test/scoped_task_environment.h"
#include "fuchsia/base/fit_adapter.h" #include "fuchsia/base/fit_adapter.h"
#include "fuchsia/base/frame_test_util.h" #include "fuchsia/base/frame_test_util.h"
#include "fuchsia/base/result_receiver.h" #include "fuchsia/base/result_receiver.h"
...@@ -93,7 +94,9 @@ class WebEngineDebugIntegrationTest : public testing::Test { ...@@ -93,7 +94,9 @@ class WebEngineDebugIntegrationTest : public testing::Test {
fuchsia::web::ContextError::REMOTE_DEBUGGING_PORT_NOT_OPENED); fuchsia::web::ContextError::REMOTE_DEBUGGING_PORT_NOT_OPENED);
} }
base::MessageLoopForIO message_loop_; base::test::ScopedTaskEnvironment scoped_task_environment_{
base::test::ScopedTaskEnvironment::ThreadingMode::MAIN_THREAD_ONLY,
base::test::ScopedTaskEnvironment::MainThreadType::IO};
TestDebugListener dev_tools_listener_; TestDebugListener dev_tools_listener_;
fidl::Binding<fuchsia::web::DevToolsListener> dev_tools_listener_binding_; fidl::Binding<fuchsia::web::DevToolsListener> dev_tools_listener_binding_;
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
#include "base/fuchsia/scoped_service_binding.h" #include "base/fuchsia/scoped_service_binding.h"
#include "base/fuchsia/service_directory.h" #include "base/fuchsia/service_directory.h"
#include "base/fuchsia/service_directory_client.h" #include "base/fuchsia/service_directory_client.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/scoped_task_environment.h"
#include "base/test/test_timeouts.h" #include "base/test/test_timeouts.h"
#include "base/threading/sequenced_task_runner_handle.h" #include "base/threading/sequenced_task_runner_handle.h"
#include "fuchsia/base/agent_impl.h" #include "fuchsia/base/agent_impl.h"
...@@ -242,7 +242,9 @@ class CastRunnerIntegrationTest : public testing::Test { ...@@ -242,7 +242,9 @@ class CastRunnerIntegrationTest : public testing::Test {
} }
const base::RunLoop::ScopedRunTimeoutForTest run_timeout_; const base::RunLoop::ScopedRunTimeoutForTest run_timeout_;
base::MessageLoopForIO message_loop_; base::test::ScopedTaskEnvironment scoped_task_environment_{
base::test::ScopedTaskEnvironment::ThreadingMode::MAIN_THREAD_ONLY,
base::test::ScopedTaskEnvironment::MainThreadType::IO};
net::EmbeddedTestServer test_server_; net::EmbeddedTestServer test_server_;
// Returns fake Cast application information to the CastRunner. // Returns fake Cast application information to the CastRunner.
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/fuchsia/service_directory_client.h" #include "base/fuchsia/service_directory_client.h"
#include "base/fuchsia/service_provider_impl.h" #include "base/fuchsia/service_provider_impl.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/scoped_task_environment.h"
#include "base/test/test_timeouts.h" #include "base/test/test_timeouts.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/embedded_test_server.h"
...@@ -84,7 +85,9 @@ class WebRunnerSmokeTest : public testing::Test { ...@@ -84,7 +85,9 @@ class WebRunnerSmokeTest : public testing::Test {
bool test_html_requested_ = false; bool test_html_requested_ = false;
bool test_image_requested_ = false; bool test_image_requested_ = false;
base::MessageLoopForIO message_loop_; base::test::ScopedTaskEnvironment scoped_task_environment_{
base::test::ScopedTaskEnvironment::ThreadingMode::MAIN_THREAD_ONLY,
base::test::ScopedTaskEnvironment::MainThreadType::IO};
std::unique_ptr<base::fuchsia::ServiceDirectory> service_directory_; std::unique_ptr<base::fuchsia::ServiceDirectory> service_directory_;
std::unique_ptr<base::fuchsia::ServiceProviderImpl> service_provider_; std::unique_ptr<base::fuchsia::ServiceProviderImpl> service_provider_;
......
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