Commit d30014c6 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Use ScopedTaskEnvironment instead of MessageLoopForUI in /chrome/updater

MessageLoopForUI will go away, eventually.

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

Change-Id: Ibc61f14dd20f016f4c1a56b2915a609fa2d682c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715500
Auto-Submit: Carlos Caballero <carlscab@google.com>
Reviewed-by: default avatarSorin Jianu <sorin@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#680915}
parent ca6346c8
...@@ -3,15 +3,17 @@ ...@@ -3,15 +3,17 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/updater/win/net/network.h" #include "chrome/updater/win/net/network.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/scoped_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace updater { namespace updater {
TEST(UpdaterTestNetwork, NetworkFetcherWinHTTPFactory) { TEST(UpdaterTestNetwork, NetworkFetcherWinHTTPFactory) {
base::MessageLoopForUI message_loop; base::test::ScopedTaskEnvironment scoped_task_environment(
base::test::ScopedTaskEnvironment::MainThreadType::UI);
auto fetcher = base::MakeRefCounted<NetworkFetcherFactory>()->Create(); auto fetcher = base::MakeRefCounted<NetworkFetcherFactory>()->Create();
EXPECT_NE(nullptr, fetcher.get()); EXPECT_NE(nullptr, fetcher.get());
} }
......
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