diff options
author | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 20:17:24 +0000 |
---|---|---|
committer | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 20:17:24 +0000 |
commit | e9a6ff49bc07fdca1fa1107fe486ae8555c6a389 (patch) | |
tree | a595be3fa7e46eb92dc2ddae9ceaf5b32abeb859 /chrome/browser/sync | |
parent | 55692c05c47fad429db892025692d6fd370590cc (diff) | |
download | chromium_src-e9a6ff49bc07fdca1fa1107fe486ae8555c6a389.zip chromium_src-e9a6ff49bc07fdca1fa1107fe486ae8555c6a389.tar.gz chromium_src-e9a6ff49bc07fdca1fa1107fe486ae8555c6a389.tar.bz2 |
Unit tests that use ProfileSyncServiceMock are leaking due to adding a DataSource (SyncResourcesSource) to ChromeURLDataManager.
The basic problem is that the destructors need to be called on the UI thread, but at shutdown the UI thread (which is the only thread left) is not recognized so the destruction is thrown to the thread even though the message loop is no longer running. This means that the messages are dropped and memory is leaked.
I added cleanup code to the destructor.
BUG=70782
TEST=Valgrind
Review URL: http://codereview.chromium.org/6317017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72876 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/profile_sync_service_mock.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/sync/profile_sync_service_mock.cc b/chrome/browser/sync/profile_sync_service_mock.cc index 8bfdb10..f843159 100644 --- a/chrome/browser/sync/profile_sync_service_mock.cc +++ b/chrome/browser/sync/profile_sync_service_mock.cc @@ -3,7 +3,12 @@ // found in the LICENSE file. #include "chrome/browser/sync/profile_sync_service_mock.h" +#include "chrome/browser/dom_ui/chrome_url_data_manager.h" +#include "chrome/common/url_constants.h" ProfileSyncServiceMock::ProfileSyncServiceMock() {} -ProfileSyncServiceMock::~ProfileSyncServiceMock() {} +ProfileSyncServiceMock::~ProfileSyncServiceMock() { + ChromeURLDataManager::GetInstance()->RemoveDataSourceForTest( + chrome::kChromeUISyncResourcesHost); +} |