Commit 5b0f1e22 authored by Francois Doray's avatar Francois Doray Committed by Commit Bot

Remove usage of ScopedTaskScheduler from browser_process_impl_unittest.cc.

ScopedTaskScheduler is deprecated.

Bug: 708584
Change-Id: I011a4eab603068729a0c754e4e4dc6a33b23ec77
Reviewed-on: https://chromium-review.googlesource.com/586924Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Francois Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490773}
parent 907c90c9
......@@ -11,7 +11,7 @@
#include "base/message_loop/message_loop.h"
#include "base/metrics/user_metrics.h"
#include "base/run_loop.h"
#include "base/test/scoped_task_scheduler.h"
#include "base/task_scheduler/task_scheduler.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile_manager.h"
......@@ -20,6 +20,10 @@
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_WIN)
#include "base/win/scoped_com_initializer.h"
#endif
class BrowserProcessImplTest : public ::testing::Test {
protected:
BrowserProcessImplTest()
......@@ -48,8 +52,8 @@ class BrowserProcessImplTest : public ::testing::Test {
// The UI thread needs to be alive while BrowserProcessImpl is alive, and is
// managed separately.
void StartSecondaryThreads() {
scoped_task_scheduler_ = base::MakeUnique<base::test::ScopedTaskScheduler>(
base::MessageLoop::current());
base::TaskScheduler::CreateAndStartWithDefaultParams(
"BrowserProcessImplTest");
file_thread_->StartIOThread();
io_thread_->StartIOThread();
}
......@@ -64,7 +68,9 @@ class BrowserProcessImplTest : public ::testing::Test {
base::RunLoop().RunUntilIdle();
file_thread_.reset();
base::RunLoop().RunUntilIdle();
scoped_task_scheduler_.reset();
base::TaskScheduler::GetInstance()->Shutdown();
base::TaskScheduler::GetInstance()->JoinForTesting();
base::TaskScheduler::SetInstance(nullptr);
}
BrowserProcessImpl* browser_process_impl() {
......@@ -75,7 +81,9 @@ class BrowserProcessImplTest : public ::testing::Test {
BrowserProcess* stashed_browser_process_;
base::MessageLoop loop_;
content::TestBrowserThread ui_thread_;
std::unique_ptr<base::test::ScopedTaskScheduler> scoped_task_scheduler_;
#if defined(OS_WIN)
base::win::ScopedCOMInitializer scoped_com_initializer_;
#endif
std::unique_ptr<content::TestBrowserThread> file_thread_;
std::unique_ptr<content::TestBrowserThread> io_thread_;
base::CommandLine command_line_;
......
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