summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/browser_thread_impl.cc4
-rw-r--r--content/browser/browser_thread_impl.h2
-rw-r--r--content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc7
-rw-r--r--content/browser/service_worker/service_worker_cache_unittest.cc7
-rw-r--r--content/public/test/content_test_suite_base.cc2
-rw-r--r--content/public/test/test_browser_thread_bundle.cc4
6 files changed, 7 insertions, 19 deletions
diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc
index 641056f..0331f03 100644
--- a/content/browser/browser_thread_impl.cc
+++ b/content/browser/browser_thread_impl.cc
@@ -15,6 +15,7 @@
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/browser_thread_delegate.h"
+#include "net/disk_cache/simple/simple_backend_impl.h"
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
@@ -141,11 +142,12 @@ void BrowserThreadImpl::ShutdownThreadPool() {
}
// static
-void BrowserThreadImpl::FlushThreadPoolHelper() {
+void BrowserThreadImpl::FlushThreadPoolHelperForTesting() {
// We don't want to create a pool if none exists.
if (g_globals == NULL)
return;
g_globals.Get().blocking_pool->FlushForTesting();
+ disk_cache::SimpleBackendImpl::FlushWorkerPoolForTesting();
}
void BrowserThreadImpl::Init() {
diff --git a/content/browser/browser_thread_impl.h b/content/browser/browser_thread_impl.h
index 167cc3b..1a6d75b 100644
--- a/content/browser/browser_thread_impl.h
+++ b/content/browser/browser_thread_impl.h
@@ -61,7 +61,7 @@ class CONTENT_EXPORT BrowserThreadImpl : public BrowserThread,
// For testing.
friend class ContentTestSuiteBaseListener;
friend class TestBrowserThreadBundle;
- static void FlushThreadPoolHelper();
+ static void FlushThreadPoolHelperForTesting();
// The identifier of this thread. Only one thread can exist with a given
// identifier at a given time.
diff --git a/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc b/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc
index de8a58a..e44618b 100644
--- a/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc
+++ b/content/browser/service_worker/service_worker_cache_storage_manager_unittest.cc
@@ -12,7 +12,6 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_browser_thread_bundle.h"
-#include "net/disk_cache/simple/simple_backend_impl.h"
#include "net/url_request/url_request_context_getter.h"
#include "storage/browser/blob/blob_storage_context.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -53,12 +52,6 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test {
virtual void TearDown() OVERRIDE {
base::RunLoop().RunUntilIdle();
- disk_cache::SimpleBackendImpl::FlushWorkerPoolForTesting();
- base::RunLoop().RunUntilIdle();
- cache_manager_.reset();
- base::RunLoop().RunUntilIdle();
- disk_cache::SimpleBackendImpl::FlushWorkerPoolForTesting();
- base::RunLoop().RunUntilIdle();
}
virtual bool MemoryOnly() { return false; }
diff --git a/content/browser/service_worker/service_worker_cache_unittest.cc b/content/browser/service_worker/service_worker_cache_unittest.cc
index b4dcc3a..0f3c5ea 100644
--- a/content/browser/service_worker/service_worker_cache_unittest.cc
+++ b/content/browser/service_worker/service_worker_cache_unittest.cc
@@ -14,7 +14,6 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_browser_thread_bundle.h"
-#include "net/disk_cache/simple/simple_backend_impl.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_job_factory_impl.h"
@@ -80,12 +79,6 @@ class ServiceWorkerCacheTest : public testing::Test {
virtual void TearDown() OVERRIDE {
base::RunLoop().RunUntilIdle();
- disk_cache::SimpleBackendImpl::FlushWorkerPoolForTesting();
- base::RunLoop().RunUntilIdle();
- cache_ = NULL;
- base::RunLoop().RunUntilIdle();
- disk_cache::SimpleBackendImpl::FlushWorkerPoolForTesting();
- base::RunLoop().RunUntilIdle();
}
void CreateRequests(ChromeBlobStorageContext* blob_storage_context) {
diff --git a/content/public/test/content_test_suite_base.cc b/content/public/test/content_test_suite_base.cc
index 1da2533..6fa29b0 100644
--- a/content/public/test/content_test_suite_base.cc
+++ b/content/public/test/content_test_suite_base.cc
@@ -44,7 +44,7 @@ class ContentTestSuiteBaseListener : public testing::EmptyTestEventListener {
ContentTestSuiteBaseListener() {
}
virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE {
- BrowserThreadImpl::FlushThreadPoolHelper();
+ BrowserThreadImpl::FlushThreadPoolHelperForTesting();
}
private:
DISALLOW_COPY_AND_ASSIGN(ContentTestSuiteBaseListener);
diff --git a/content/public/test/test_browser_thread_bundle.cc b/content/public/test/test_browser_thread_bundle.cc
index 86ff725..a9e1073 100644
--- a/content/public/test/test_browser_thread_bundle.cc
+++ b/content/public/test/test_browser_thread_bundle.cc
@@ -24,7 +24,7 @@ TestBrowserThreadBundle::~TestBrowserThreadBundle() {
// pool via PostTaskAndReply are able to reply back to the originating thread.
// Thus we must flush the blocking pool while the browser threads still exist.
base::RunLoop().RunUntilIdle();
- BrowserThreadImpl::FlushThreadPoolHelper();
+ BrowserThreadImpl::FlushThreadPoolHelperForTesting();
// To ensure a clean teardown, each thread's message loop must be flushed
// just before the thread is destroyed. But destroying a fake thread does not
@@ -46,7 +46,7 @@ TestBrowserThreadBundle::~TestBrowserThreadBundle() {
// This is the point at which we normally shut down the thread pool. So flush
// it again in case any shutdown tasks have been posted to the pool from the
// threads above.
- BrowserThreadImpl::FlushThreadPoolHelper();
+ BrowserThreadImpl::FlushThreadPoolHelperForTesting();
base::RunLoop().RunUntilIdle();
ui_thread_.reset();
base::RunLoop().RunUntilIdle();