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

Use ScopedTaskEnvironment instead of MessageLoop in /third_party/libaddressinput

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

Change-Id: I0d16e66a8b67117567d04884ebe7584fd7ea5926
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1649369
Auto-Submit: Carlos Caballero <carlscab@google.com>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#667137}
parent dd8c1002
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
#include <vector> #include <vector>
#include "base/macros.h" #include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_data.h" #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_data.h"
#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_problem.h" #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_problem.h"
...@@ -922,7 +922,7 @@ class FailingAddressValidatorTest : public testing::Test, LoadRulesListener { ...@@ -922,7 +922,7 @@ class FailingAddressValidatorTest : public testing::Test, LoadRulesListener {
load_rules_success_ = success; load_rules_success_ = success;
} }
base::MessageLoop ui_; base::test::ScopedTaskEnvironment scoped_task_environment_;
DISALLOW_COPY_AND_ASSIGN(FailingAddressValidatorTest); DISALLOW_COPY_AND_ASSIGN(FailingAddressValidatorTest);
}; };
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#include "third_party/libaddressinput/chromium/chrome_metadata_source.h" #include "third_party/libaddressinput/chromium/chrome_metadata_source.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 "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "mojo/core/embedder/embedder.h" #include "mojo/core/embedder/embedder.h"
#include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/shared_url_loader_factory.h"
...@@ -64,7 +64,7 @@ class ChromeMetadataSourceTest : public testing::Test { ...@@ -64,7 +64,7 @@ class ChromeMetadataSourceTest : public testing::Test {
data_.reset(data); data_.reset(data);
} }
base::MessageLoop loop_; base::test::ScopedTaskEnvironment scoped_task_environment_;
network::TestURLLoaderFactory test_url_loader_factory_; network::TestURLLoaderFactory test_url_loader_factory_;
scoped_refptr<network::SharedURLLoaderFactory> test_shared_loader_factory_; scoped_refptr<network::SharedURLLoaderFactory> test_shared_loader_factory_;
GURL url_; GURL url_;
......
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