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

Unified Diff: content/browser/site_instance_impl_unittest.cc

Issue 10908027: Fix an AppCacheStorageImpl leak in SiteInstanceTest.SiteInstanceDestructor by running the message l… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_instance_impl_unittest.cc
===================================================================
--- content/browser/site_instance_impl_unittest.cc (revision 155116)
+++ content/browser/site_instance_impl_unittest.cc (working copy)
@@ -82,8 +82,7 @@
}
};
-class SiteInstanceTestBrowserClient :
- public content::TestContentBrowserClient {
+class SiteInstanceTestBrowserClient : public content::TestContentBrowserClient {
public:
SiteInstanceTestBrowserClient()
: privileged_process_id_(-1) {
@@ -135,6 +134,17 @@
content::GetContentClient()->set_browser_for_testing(old_browser_client_);
content::SetContentClient(old_client_);
+
+ // http://crbug.com/143565 found SiteInstanceTest leaking an
+ // AppCacheDatabase. This happens because some part of the test indirectly
+ // calls StoragePartitionImplMap::PostCreateInitialization(), which posts
+ // a task to the IO thread to create the AppCacheDatabase. Since the
+ // message loop is not running, the AppCacheDatabase ends up getting
+ // created when DrainMessageLoops() gets called at the end of a test case.
+ // Immediately after, the test case ends and the AppCacheDatabase gets
+ // scheduled for deletion. Here, call DrainMessageLoops() again so the
+ // AppCacheDatabase actually gets deleted.
+ DrainMessageLoops();
}
void set_privileged_process_id(int process_id) {
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698