diff options
author | ericu@chromium.org <ericu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-04 21:44:27 +0000 |
---|---|---|
committer | ericu@chromium.org <ericu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-04 21:44:27 +0000 |
commit | fdbde89a6f89204cc9bdf6dc45dc03ca7f200582 (patch) | |
tree | 78629687014f9c18ee00bc95620ef80b9c93ee08 /webkit | |
parent | 14a2f25c462b9e2695526066497883d0f098bf8f (diff) | |
download | chromium_src-fdbde89a6f89204cc9bdf6dc45dc03ca7f200582.zip chromium_src-fdbde89a6f89204cc9bdf6dc45dc03ca7f200582.tar.gz chromium_src-fdbde89a6f89204cc9bdf6dc45dc03ca7f200582.tar.bz2 |
Fix memory leaks in tests.
With the new filesystem URL parser, the invalid URLs used in the InvalidURL test
are now recognized as invalid far earlier, so the job wasn't even getting
requested from the factory, and so wasn't getting deleted.
BUG=121571
TEST=FileSystem[Dir]URLRequestJobTest.InvalidURL under valgrind
Review URL: http://codereview.chromium.org/9956121
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130741 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/fileapi/file_system_dir_url_request_job_unittest.cc | 8 | ||||
-rw-r--r-- | webkit/fileapi/file_system_url_request_job_unittest.cc | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc index c0f3bdf..d124e7e 100644 --- a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc +++ b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc @@ -83,6 +83,7 @@ class FileSystemDirURLRequestJobTest : public testing::Test { delegate_.reset(NULL); net::URLRequest::Deprecated::RegisterProtocolFactory("filesystem", NULL); + ClearUnusedJob(); } void OnValidateFileSystem(base::PlatformFileError result) { @@ -201,6 +202,13 @@ class FileSystemDirURLRequestJobTest : public testing::Test { return temp; } + static void ClearUnusedJob() { + if (job_) { + scoped_refptr<net::URLRequestJob> deleter = job_; + job_ = NULL; + } + } + FileSystemFileUtil* file_util() { return file_system_context_->sandbox_provider()->GetFileUtil(); } diff --git a/webkit/fileapi/file_system_url_request_job_unittest.cc b/webkit/fileapi/file_system_url_request_job_unittest.cc index 16986e2..b8151ac 100644 --- a/webkit/fileapi/file_system_url_request_job_unittest.cc +++ b/webkit/fileapi/file_system_url_request_job_unittest.cc @@ -98,6 +98,7 @@ class FileSystemURLRequestJobTest : public testing::Test { virtual void TearDown() { net::URLRequest::Deprecated::RegisterProtocolFactory("filesystem", NULL); + ClearUnusedJob(); } void OnValidateFileSystem(base::PlatformFileError result) { @@ -194,6 +195,13 @@ class FileSystemURLRequestJobTest : public testing::Test { return temp; } + static void ClearUnusedJob() { + if (job_) { + scoped_refptr<net::URLRequestJob> deleter = job_; + job_ = NULL; + } + } + // Put the message loop at the top, so that it's the last thing deleted. MessageLoop message_loop_; |