Commit 0d851f87 authored by Ilia Samsonov's avatar Ilia Samsonov Committed by Commit Bot

Reinit PnaclHost taskRunner for tests.

The purpose of this cl is to prevent the tests from crashing
on all platforms when running in a batch.

The Task Runner outlives the PooledTaskRunnerDelegate,
which it holds a reference too.
This causes failure in batch test run.

Bug: 1002573
Change-Id: I5fca10116e7b40a2b70bf867d55165b8b5825708
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1794303Reviewed-by: default avatarDerek Schuff <dschuff@chromium.org>
Commit-Queue: Ilia Samsonov <isamsonov@google.com>
Cr-Commit-Position: refs/heads/master@{#695256}
parent 9aebe9de
...@@ -158,9 +158,13 @@ void PnaclHost::Init() { ...@@ -158,9 +158,13 @@ void PnaclHost::Init() {
} }
// Initialize for testing, optionally using the in-memory backend, and manually // Initialize for testing, optionally using the in-memory backend, and manually
// setting the temporary file directory instead of using the system directory. // setting the temporary file directory instead of using the system directory,
// and re-initializing file task runner.
void PnaclHost::InitForTest(base::FilePath temp_dir, bool in_memory) { void PnaclHost::InitForTest(base::FilePath temp_dir, bool in_memory) {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
file_task_runner_ =
base::CreateSequencedTaskRunner({base::ThreadPool(), base::MayBlock(),
base::TaskPriority::USER_VISIBLE});
disk_cache_.reset(new PnaclTranslationCache()); disk_cache_.reset(new PnaclTranslationCache());
cache_state_ = CacheInitializing; cache_state_ = CacheInitializing;
temp_dir_ = temp_dir; temp_dir_ = temp_dir;
......
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