Commit 9798801d authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Remove references of MessageLoopForIO in /jingle

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=zea@chromium.org

Change-Id: I85626fd1fddb7d36b61b60574b5a6868630d4ed5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733550Reviewed-by: default avatarNicolas Zea <zea@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#685560}
parent 36057dca
......@@ -10,8 +10,8 @@
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/test/scoped_task_environment.h"
#include "base/threading/thread.h"
#include "jingle/glue/network_service_config_test_util.h"
#include "jingle/notifier/base/notifier_options.h"
......@@ -27,14 +27,15 @@ class PushClientTest : public testing::Test {
PushClientTest()
: net_config_helper_(
base::MakeRefCounted<net::TestURLRequestContextGetter>(
message_loop_.task_runner())) {
scoped_task_environment_.GetMainThreadTaskRunner())) {
net_config_helper_.FillInNetworkConfig(&notifier_options_.network_config);
}
~PushClientTest() override {}
// The sockets created by the XMPP code expect an IO loop.
base::MessageLoopForIO message_loop_;
base::test::ScopedTaskEnvironment scoped_task_environment_{
base::test::ScopedTaskEnvironment::MainThreadType::IO};
jingle_glue::NetworkServiceConfigTestUtil net_config_helper_;
NotifierOptions notifier_options_;
};
......
......@@ -7,8 +7,8 @@
#include <memory>
#include "base/compiler_specific.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/test/scoped_task_environment.h"
#include "jingle/glue/network_service_config_test_util.h"
#include "jingle/notifier/base/fake_base_task.h"
#include "jingle/notifier/base/notifier_options.h"
......@@ -38,7 +38,7 @@ class XmppPushClientTest : public testing::Test {
XmppPushClientTest()
: net_config_helper_(
base::MakeRefCounted<net::TestURLRequestContextGetter>(
message_loop_.task_runner())) {
scoped_task_environment_.GetMainThreadTaskRunner())) {
net_config_helper_.FillInNetworkConfig(&notifier_options_.network_config);
}
......@@ -57,7 +57,8 @@ class XmppPushClientTest : public testing::Test {
}
// The sockets created by the XMPP code expect an IO loop.
base::MessageLoopForIO message_loop_;
base::test::ScopedTaskEnvironment scoped_task_environment_{
base::test::ScopedTaskEnvironment::MainThreadType::IO};
jingle_glue::NetworkServiceConfigTestUtil net_config_helper_;
NotifierOptions notifier_options_;
......
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