Chromium Code Reviews| Index: content/browser/site_instance_impl_unittest.cc |
| =================================================================== |
| --- content/browser/site_instance_impl_unittest.cc (revision 155079) |
| +++ content/browser/site_instance_impl_unittest.cc (working copy) |
| @@ -2,6 +2,9 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include <string> |
|
jam
2012/09/06 16:58:03
including string is quite unnecessary.. i would sa
Lei Zhang
2012/09/06 18:16:43
Ok, maybe we should take it out of the linter...
|
| +#include <vector> |
| + |
| #include "base/command_line.h" |
| #include "base/compiler_specific.h" |
| #include "base/stl_util.h" |
| @@ -82,8 +85,7 @@ |
| } |
| }; |
| -class SiteInstanceTestBrowserClient : |
| - public content::TestContentBrowserClient { |
| +class SiteInstanceTestBrowserClient : public content::TestContentBrowserClient { |
| public: |
| SiteInstanceTestBrowserClient() |
| : privileged_process_id_(-1) { |
| @@ -135,6 +137,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) { |