summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-14 07:45:00 +0000
committernhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-14 07:45:00 +0000
commite375b8a4106fe8caad88d80f33576835b6a0bf74 (patch)
tree2cea9a99182d34e420021a21d0af0d962d86fa89
parent57e1afb55742fecf4844acf8508f50a07d200926 (diff)
downloadchromium_src-e375b8a4106fe8caad88d80f33576835b6a0bf74.zip
chromium_src-e375b8a4106fe8caad88d80f33576835b6a0bf74.tar.gz
chromium_src-e375b8a4106fe8caad88d80f33576835b6a0bf74.tar.bz2
SyncFS: Fix memory leaks on unit_tests
SyncFileSystemBackend posts a delete task to the IO thread, but some tests do not wait for completion of the task and it causes memory leaks. This change makes them wait for completion. BUG=282646 TEST=unit_tests --gtest_filter=DeclarativeContentRulesRegistryTest.* TEST=unit_tests --gtest_filter=DeclarativeContentActionTest.* TEST=unit_tests --gtest_filter=SavedFilesServiceUnitTest.* Review URL: https://codereview.chromium.org/71223003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235092 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/test_extension_environment.cc2
-rw-r--r--tools/heapcheck/suppressions.txt16
-rw-r--r--tools/lsan/suppressions.txt5
-rw-r--r--tools/valgrind/memcheck/suppressions.txt11
4 files changed, 2 insertions, 32 deletions
diff --git a/chrome/browser/extensions/test_extension_environment.cc b/chrome/browser/extensions/test_extension_environment.cc
index e501156..805ea2d 100644
--- a/chrome/browser/extensions/test_extension_environment.cc
+++ b/chrome/browser/extensions/test_extension_environment.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/test/base/testing_profile.h"
+#include "content/public/test/test_utils.h"
#include "content/public/test/web_contents_tester.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/value_builder.h"
@@ -51,6 +52,7 @@ TestExtensionEnvironment::~TestExtensionEnvironment() {
// Delete the profile, and then cycle the message loop to clear
// out delayed deletions.
base::RunLoop().RunUntilIdle();
+ content::RunAllPendingInMessageLoop(content::BrowserThread::IO);
}
TestingProfile* TestExtensionEnvironment::profile() const {
diff --git a/tools/heapcheck/suppressions.txt b/tools/heapcheck/suppressions.txt
index 76dd000..4c44703 100644
--- a/tools/heapcheck/suppressions.txt
+++ b/tools/heapcheck/suppressions.txt
@@ -824,22 +824,6 @@
fun:SavedFilesServiceUnitTest::SavedFilesServiceUnitTest
}
{
- bug_282646
- Heapcheck:Leak
- ...
- fun:SyncFileSystemBackend
- fun:chrome::ChromeContentBrowserClient::GetAdditionalFileSystemBackends
- fun:content::CreateFileSystemContext
- fun:content::StoragePartitionImpl::Create
- fun:content::StoragePartitionImplMap::Get
- fun:GetStoragePartitionFromConfig
- fun:content::BrowserContext::GetStoragePartitionForSite
- fun:ExtensionService::NotifyExtensionUnloaded
- fun:ExtensionService::UnloadExtension
- fun:ExtensionService::AddExtension
- fun:extensions::TestExtensionEnvironment::MakeExtension
-}
-{
bug_286185
Heapcheck:Leak
fun:sqlite3MemMalloc
diff --git a/tools/lsan/suppressions.txt b/tools/lsan/suppressions.txt
index bf06b5e..2755c66 100644
--- a/tools/lsan/suppressions.txt
+++ b/tools/lsan/suppressions.txt
@@ -80,11 +80,6 @@ leak:cc::TileManager::ManageTiles
# Leak in cc_unittests. http://crbug.com/317970
leak:cc::FakeTileManager::AssignMemoryToTiles
-# Leak in unit_tests. http://crbug.com/282646
-leak:DeclarativeContentActionTest_ShowPageAction_Test::TestBody
-leak:DeclarativeContentRulesRegistryTest_ActiveRulesDoesntGrow_Test::TestBody
-leak:SavedFilesServiceUnitTest_NoRetainEntriesPermissionTest_Test::TestBody
-
# Leak in unit_tests. http://crbug.com/309468
leak:TranslateBubbleViewTest::SetUp
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index e309d87..dc0d2c9 100644
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -6075,17 +6075,6 @@
fun:_ZN3gpu13CommandParser14ProcessCommandEv
}
{
- bug_282646
- Memcheck:Leak
- fun:_Znw*
- fun:_ZN16sync_file_system21SyncFileSystemBackendC1EP7Profile
- fun:_ZN6chrome26ChromeContentBrowserClient31GetAdditionalFileSystemBackendsEPN7content14BrowserContextERKN4base8FilePathEP12ScopedVectorIN7fileapi17FileSystemBackendEE
- fun:_ZN7content23CreateFileSystemContextEPNS_14BrowserContextERKN4base8FilePathEbPN5quota17QuotaManagerProxyE
- fun:_ZN7content20StoragePartitionImpl6CreateEPNS_14BrowserContextEbRKN4base8FilePathE
- fun:_ZN7content23StoragePartitionImplMap3GetERKSsS2_b
- fun:_ZN7content12_GLOBAL__N_129GetStoragePartitionFromConfigEPNS_14BrowserContextERKSsS4_b
-}
-{
bug_288787
Memcheck:Leak
fun:_Znw*