Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: components/precache/content/precache_manager_unittest.cc

Issue 1864583006: Simplify BrowserContext by removing redundant methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/precache/content/precache_manager.cc ('k') | content/browser/browser_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/precache/content/precache_manager_unittest.cc
diff --git a/components/precache/content/precache_manager_unittest.cc b/components/precache/content/precache_manager_unittest.cc
index 5e0fde422c230cd8d9f0113461e91dcf8136c24b..b44ef3e8c3afa0569a2c7f63cd268f1ab6d3482e 100644
--- a/components/precache/content/precache_manager_unittest.cc
+++ b/components/precache/content/precache_manager_unittest.cc
@@ -141,6 +141,15 @@ class PrecacheManagerTest : public testing::Test {
base::Bind(&TestURLFetcherCallback::CreateURLFetcher,
base::Unretained(&url_callback_))) {}
+ ~PrecacheManagerTest() {
+ // precache_manager_'s constructor releases a PrecacheDatabase and deletes
+ // it on the DB thread. PrecacheDatabase already has a pending Init call
+ // which will assert in debug builds because the directory passed to it is
+ // deleted. So manually ensure that the task is run before browser_context_
+ // is destructed.
+ base::MessageLoop::current()->RunUntilIdle();
+ }
+
protected:
void SetUp() override {
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
@@ -156,8 +165,8 @@ class PrecacheManagerTest : public testing::Test {
}
// Must be declared first so that it is destroyed last.
- content::TestBrowserContext browser_context_;
content::TestBrowserThreadBundle test_browser_thread_bundle_;
+ content::TestBrowserContext browser_context_;
PrecacheManagerUnderTest precache_manager_;
TestURLFetcherCallback url_callback_;
net::FakeURLFetcherFactory factory_;
« no previous file with comments | « components/precache/content/precache_manager.cc ('k') | content/browser/browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698