| Index: chrome/browser/history/web_history_service_unittest.cc
|
| diff --git a/chrome/browser/history/web_history_service_unittest.cc b/chrome/browser/history/web_history_service_unittest.cc
|
| index 3d20a897c37bdf8e7749baa588dfa3abd5676889..e53671d6af5e0b461aeaae34e5ac0449c89515fe 100644
|
| --- a/chrome/browser/history/web_history_service_unittest.cc
|
| +++ b/chrome/browser/history/web_history_service_unittest.cc
|
| @@ -4,8 +4,11 @@
|
|
|
| #include "components/history/core/browser/web_history_service.h"
|
|
|
| +#include "base/location.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/run_loop.h"
|
| +#include "base/single_thread_task_runner.h"
|
| +#include "base/thread_task_runner_handle.h"
|
| #include "chrome/browser/history/web_history_service_factory.h"
|
| #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
|
| #include "chrome/browser/signin/signin_manager_factory.h"
|
| @@ -126,7 +129,7 @@ class TestRequest : public WebHistoryService::Request {
|
|
|
| void Start() override {
|
| is_pending_ = true;
|
| - base::MessageLoop::current()->PostTask(
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| FROM_HERE,
|
| base::Bind(&TestRequest::MimicReturnFromFetch, base::Unretained(this)));
|
| }
|
| @@ -235,7 +238,8 @@ class WebHistoryServiceTest : public testing::Test {
|
| }
|
| void TearDown() override {
|
| base::RunLoop run_loop;
|
| - base::MessageLoop::current()->PostTask(FROM_HERE, run_loop.QuitClosure());
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
|
| + run_loop.QuitClosure());
|
| run_loop.Run();
|
| }
|
| Profile* profile() { return &profile_; }
|
| @@ -265,10 +269,10 @@ TEST_F(WebHistoryServiceTest, GetAudioHistoryEnabled) {
|
| web_history_service->GetAudioHistoryEnabled(
|
| base::Bind(&TestingWebHistoryService::GetAudioHistoryCallback,
|
| base::Unretained(web_history_service)));
|
| - base::MessageLoop::current()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain,
|
| - base::Unretained(web_history_service)));
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain,
|
| + base::Unretained(web_history_service)));
|
| }
|
|
|
| TEST_F(WebHistoryServiceTest, SetAudioHistoryEnabledTrue) {
|
| @@ -286,10 +290,10 @@ TEST_F(WebHistoryServiceTest, SetAudioHistoryEnabledTrue) {
|
| true,
|
| base::Bind(&TestingWebHistoryService::SetAudioHistoryCallback,
|
| base::Unretained(web_history_service)));
|
| - base::MessageLoop::current()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain,
|
| - base::Unretained(web_history_service)));
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain,
|
| + base::Unretained(web_history_service)));
|
| }
|
|
|
| TEST_F(WebHistoryServiceTest, SetAudioHistoryEnabledFalse) {
|
| @@ -307,10 +311,10 @@ TEST_F(WebHistoryServiceTest, SetAudioHistoryEnabledFalse) {
|
| false,
|
| base::Bind(&TestingWebHistoryService::SetAudioHistoryCallback,
|
| base::Unretained(web_history_service)));
|
| - base::MessageLoop::current()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain,
|
| - base::Unretained(web_history_service)));
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain,
|
| + base::Unretained(web_history_service)));
|
| }
|
|
|
| TEST_F(WebHistoryServiceTest, MultipleRequests) {
|
| @@ -337,10 +341,10 @@ TEST_F(WebHistoryServiceTest, MultipleRequests) {
|
| base::Unretained(web_history_service)));
|
|
|
| // Check that both requests are no longer pending.
|
| - base::MessageLoop::current()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain,
|
| - base::Unretained(web_history_service)));
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain,
|
| + base::Unretained(web_history_service)));
|
| }
|
|
|
| TEST_F(WebHistoryServiceTest, VerifyReadResponse) {
|
|
|