Commit 8c402c02 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Use ScopedTaskEnvironment instead of MessageLoop

MessageLoop will go away, eventually.

ScopedTaskEnvironment will per default start a ThreadPool, which should
be fine in most of the cases. If you belive 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=mcasas@chromium.org

Change-Id: I3c7f0757fba9484cd6a44f5bb2cdac434cdd3fc3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635814
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Auto-Submit: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#665948}
parent 93e52146
......@@ -15,12 +15,12 @@
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_task_environment.h"
#include "base/values.h"
#include "net/base/net_errors.h"
#include "services/device/geolocation/fake_position_cache.h"
......@@ -284,7 +284,7 @@ class GeolocationNetworkProviderTest : public testing::Test {
}
}
const base::MessageLoop main_message_loop_;
const base::test::ScopedTaskEnvironment scoped_task_environment_;
network::TestURLLoaderFactory test_url_loader_factory_;
const scoped_refptr<MockWifiDataProvider> wifi_data_provider_;
FakePositionCache position_cache_;
......@@ -292,7 +292,6 @@ class GeolocationNetworkProviderTest : public testing::Test {
// Tests that fixture members were SetUp correctly.
TEST_F(GeolocationNetworkProviderTest, CreateDestroy) {
EXPECT_TRUE(main_message_loop_.task_runner()->RunsTasksInCurrentSequence());
std::unique_ptr<LocationProvider> provider(CreateProvider(true));
EXPECT_TRUE(provider);
provider.reset();
......
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