Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: net/test/net_test_suite.cc

Issue 2839663002: Instantiate ScopedTaskEnvironment in net unittests. (Closed)
Patch Set: self-review Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/test/net_test_suite.cc
diff --git a/net/test/net_test_suite.cc b/net/test/net_test_suite.cc
index ff466e6e82bea025d4c81d725e1d74eb6a458818..2c6be66d13e510519f87b2e1274b045be5f49eb4 100644
--- a/net/test/net_test_suite.cc
+++ b/net/test/net_test_suite.cc
@@ -4,7 +4,8 @@
#include "net/test/net_test_suite.h"
-#include "base/message_loop/message_loop.h"
+#include "base/memory/ptr_util.h"
+#include "base/test/scoped_task_environment.h"
#include "net/base/network_change_notifier.h"
#include "net/http/http_stream_factory.h"
#include "net/spdy/chromium/spdy_session.h"
@@ -32,7 +33,7 @@ void NetTestSuite::Shutdown() {
// We want to destroy this here before the TestSuite continues to tear down
// the environment.
- message_loop_.reset();
+ scoped_task_environment_.reset();
TestSuite::Shutdown();
}
@@ -51,5 +52,7 @@ void NetTestSuite::InitializeTestThreadNoNetworkChangeNotifier() {
// the process of running these unit tests.
host_resolver_proc_->AddRule("*", "127.0.0.1");
- message_loop_.reset(new base::MessageLoopForIO());
+ scoped_task_environment_ =
+ base::MakeUnique<base::test::ScopedTaskEnvironment>(
+ base::test::ScopedTaskEnvironment::MainThreadType::IO);
}

Powered by Google App Engine
This is Rietveld 408576698