summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorskyostil <skyostil@chromium.org>2015-04-27 10:59:37 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-27 17:59:35 +0000
commit0becb33779f8678e2703d6ff1a73ce2b45571f98 (patch)
treeca8e900931a5e71c07db40c308a7755b15de1870 /net
parent6974bf71b37bddb36ca8b1feefc013b7c47c105f (diff)
downloadchromium_src-0becb33779f8678e2703d6ff1a73ce2b45571f98.zip
chromium_src-0becb33779f8678e2703d6ff1a73ce2b45571f98.tar.gz
chromium_src-0becb33779f8678e2703d6ff1a73ce2b45571f98.tar.bz2
Ensure tests have an active task runner
This patch modifies all tests to have a more realistic threading set-up by either: a) adding a TestBrowserThreadBundle b) constructing any existing TestBrowserThreadBundle earlier or c) adding a MessageLoop as appropriate. This makes it possible to later migrate base/ from MessageLoopProxy over to ThreadTaskRunnerHandle, which requires an active task runner on the current thread. BUG=465354 Review URL: https://codereview.chromium.org/1086733002 Cr-Commit-Position: refs/heads/master@{#327067}
Diffstat (limited to 'net')
-rw-r--r--net/disk_cache/simple/simple_backend_impl.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc
index 3808644..b5a6c9e 100644
--- a/net/disk_cache/simple/simple_backend_impl.cc
+++ b/net/disk_cache/simple/simple_backend_impl.cc
@@ -735,7 +735,9 @@ void SimpleBackendImpl::DoomEntriesComplete(
// static
void SimpleBackendImpl::FlushWorkerPoolForTesting() {
- g_sequenced_worker_pool.Get().FlushForTesting();
+ // We only need to do this if we there is an active task runner.
+ if (base::ThreadTaskRunnerHandle::IsSet())
+ g_sequenced_worker_pool.Get().FlushForTesting();
}
} // namespace disk_cache