Commit 2a1abaac authored by falken's avatar falken Committed by Commit Bot

Revert of Enable redirection of SequencedWorkerPool to TaskScheduler in...

Revert of Enable redirection of SequencedWorkerPool to TaskScheduler in TestBrowserThreadBundle. (patchset #3 id:40001 of https://codereview.chromium.org/2769693002/ )

Reason for revert:
Caused ServiceWorkerResourceStorageDiskTest.* tests in content_unittests to crash.

See https://bugs.chromium.org/p/chromium/issues/detail?id=727994

Reverting locally fixed the crashes, so I'm going to revert this CL.

Original issue's description:
> Enable redirection of SequencedWorkerPool to TaskScheduler in TestBrowserThreadBundle.
>
> Motivation:
> - Redirection of SequencedWorkerPool to TaskScheduler is enabled in
>   browser tests and on Canary and Dev. It makes sense to enable it
>   in unit tests too.
> - It is not possible to wait until there are no more blocking pool
>   *and* TaskScheduler tasks (new tasks in the blocking pool during
>   a FlushForTesting() call on TaskScheduler and vice versa). If
>   the blocking pool is redirected to TaskScheduler, calling
>   FlushForTesting() on TaskScheduler guarantees that there are no
>   more blocking pool *and* TaskScheduler tasks.
>
> BUG=667892
>
> Review-Url: https://codereview.chromium.org/2769693002
> Cr-Commit-Position: refs/heads/master@{#475144}
> Committed: https://chromium.googlesource.com/chromium/src/+/e1aa28915a28da266d406202a07112d44d6cc018

TBR=gab@chromium.org,robliao@chromium.org,sky@chromium.org,fdoray@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=667892,727994

Review-Url: https://codereview.chromium.org/2909393003
Cr-Commit-Position: refs/heads/master@{#475816}
parent 6d317c3c
......@@ -10,7 +10,6 @@
#include "base/run_loop.h"
#include "base/task_scheduler/task_scheduler.h"
#include "base/test/scoped_async_task_scheduler.h"
#include "base/threading/sequenced_worker_pool.h"
#include "content/browser/browser_thread_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_thread.h"
......@@ -79,12 +78,6 @@ TestBrowserThreadBundle::~TestBrowserThreadBundle() {
// for DestructionObservers hooked to |message_loop_| to be able to invoke
// BrowserThread::CurrentlyOn() -- ref. ~TestBrowserThread().
message_loop_.reset();
// Disable redirection of SequencedWorkerPools to TaskScheduler. This is
// required in order to reset global state so that tests following this one in
// this process can still manage their own SequencedWorkerPool without using
// TestBrowserThreadBundle.
base::SequencedWorkerPool::EnableForProcess();
}
void TestBrowserThreadBundle::Init() {
......@@ -130,9 +123,6 @@ void TestBrowserThreadBundle::CreateThreads() {
base::MakeUnique<base::test::ScopedAsyncTaskScheduler>();
}
// Enable redirection of SequencedWorkerPools to TaskScheduler.
base::SequencedWorkerPool::EnableWithRedirectionToTaskSchedulerForProcess();
if (options_ & REAL_DB_THREAD) {
db_thread_ = base::MakeUnique<TestBrowserThread>(BrowserThread::DB);
db_thread_->Start();
......
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