Commit 75faca4b 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=rsesek@chromium.org

Change-Id: I0a25ecf615af7e81acf65422c7f91870395bb68c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636192Reviewed-by: default avatarJay Civelli <jcivelli@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Auto-Submit: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#665945}
parent 419aea49
......@@ -7,8 +7,8 @@
#include "base/bind.h"
#include "base/lazy_instance.h"
#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
#include "base/test/scoped_task_environment.h"
#include "gin/array_buffer.h"
#include "gin/public/isolate_holder.h"
#include "services/data_decoder/image_decoder_impl.h"
......@@ -108,7 +108,7 @@ class ImageDecoderImplTest : public testing::Test {
ImageDecoderImpl* decoder() { return &decoder_; }
private:
base::MessageLoop message_loop_;
base::test::ScopedTaskEnvironment scoped_task_environment_;
ImageDecoderImpl decoder_;
};
......
......@@ -9,8 +9,8 @@
#include "base/bind.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/test/scoped_task_environment.h"
#include "base/values.h"
#include "build/build_config.h"
#include "services/data_decoder/public/cpp/safe_json_parser.h"
......@@ -46,7 +46,7 @@ class JsonSanitizerTest : public ::testing::Test {
void OnSuccess(const std::string& json);
void OnError(const std::string& error);
base::MessageLoop message_loop_;
base::test::ScopedTaskEnvironment scoped_task_environment_;
#if !defined(OS_ANDROID)
TestingJsonParser::ScopedFactoryOverride factory_override_;
......
......@@ -8,8 +8,8 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/test/scoped_task_environment.h"
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -56,7 +56,7 @@ class TestingJsonParserTest : public testing::Test {
EXPECT_FALSE(error.empty());
}
base::MessageLoop message_loop;
base::test::ScopedTaskEnvironment scoped_task_environment;
TestingJsonParser::ScopedFactoryOverride factory_override_;
bool did_success_ = false;
bool did_error_ = false;
......
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